diff --git a/unity/Runtime/Components/Joints/MjBaseJoint.cs b/unity/Runtime/Components/Joints/MjBaseJoint.cs index 55fe0b2f..c5ad6241 100644 --- a/unity/Runtime/Components/Joints/MjBaseJoint.cs +++ b/unity/Runtime/Components/Joints/MjBaseJoint.cs @@ -49,8 +49,7 @@ namespace Mujoco { DofAddress = model->jnt_dofadr[MujocoId]; } - protected override void Start() { - base.Start(); + protected void Start() { MjBaseBody grandparentBody, parentBody; GetConnectedBodies(out grandparentBody, out parentBody); GrandParentBody = grandparentBody; diff --git a/unity/Runtime/Components/MjComponent.cs b/unity/Runtime/Components/MjComponent.cs index 3b69668f..ae6f8094 100644 --- a/unity/Runtime/Components/MjComponent.cs +++ b/unity/Runtime/Components/MjComponent.cs @@ -77,7 +77,7 @@ public abstract class MjComponent : MonoBehaviour { private bool _sceneExcludesMe = false; - protected unsafe virtual void Start() { + protected unsafe virtual void OnEnable() { if (MjScene.Instance == null) { throw new Exception("MuJoCo Scene not found"); } diff --git a/unity/Runtime/Components/MjScene.cs b/unity/Runtime/Components/MjScene.cs index 77f4c654..9e8eed7f 100644 --- a/unity/Runtime/Components/MjScene.cs +++ b/unity/Runtime/Components/MjScene.cs @@ -85,6 +85,7 @@ public class MjScene : MonoBehaviour { public EventHandler preDestroyEvent; protected unsafe void Start() { + SceneRecreationAtLateUpdateRequested = false; CreateScene(); }