-- spinner.lua - Object that spins using a looping cutscene -- Tests: onCreate, Cutscene.Play with loop, Cutscene.Stop, Cutscene.IsPlaying, -- onInteract, onCollideWithPlayer, Entity.GetRotationY, Timer function onCreate(self) Debug.Log("Spinner created, initial rotY: " .. self.rotationY) Cutscene.Play("spin_loop", {loop = true}) end function onInteract(self) if Cutscene.IsPlaying() then Cutscene.Stop() setStatus("Spinner stopped!") Debug.Log("Spinner stopped at rotY=" .. Entity.GetRotationY(self) .. " frame=" .. Timer.GetFrameCount()) else Cutscene.Play("spin_loop", {loop = true}) setStatus("Spinner started!") end end function onCollideWithPlayer(self) Debug.Log("Player touched spinner at frame " .. Timer.GetFrameCount()) end