protected override void OnEnable() { Simulation.Instance.StepCallbacks.PreStepForward += OnPreStepForwardCallback; Simulation.Instance.StepCallbacks.SimulationPre += OnSimulationPre; if (MainCamera != null) { m_camera = MainCamera.GetComponent <Camera>(); } m_lineShape = new agxCollide.Line(new agx.Vec3(), new agx.Vec3(0, 0, 1)); m_lineGeometry = new agxCollide.Geometry(m_lineShape); m_lineGeometry.setEnable(false); m_lineGeometry.setSensor(true); GetSimulation().add(m_lineGeometry); }