--this script will make this object jump to wherever you right click--(Example: moving objects with right click )thisGameObject = Space.Host.ExecutingObjectOnUpdate=function()if Space.Input.GetMouseDown(1) then clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition) rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0) thisGameObject.WorldPosition = rayCastHit.PositionendendthisGameObject.SubscribeToEvents()thisGameObject.OnUpdate(OnUpdate)
--this script will make this object jump to wherever you right click--(Example: moving objects with right click )thisGameObject = Space.Host.ExecutingObjectOnUpdate=function()if Space.Input.GetMouseDown(1) then clickRay = Space.Camera.ScreenCoordinatesToRay(Space.Input.MousePosition) rayCastHit = Space.Physics.RayCastSingle(clickRay.Origin, clickRay.Direction, 50.0) thisGameObject.WorldPosition = rayCastHit.PositionendendthisGameObject.SubscribeToEvents()thisGameObject.OnUpdate(OnUpdate)