Rotating
Continuously rotate an object around its axis.
Introduction
Rotating spins an object around an axis you pick, either for a fixed angle or nonstop. Turnstiles, spinning fans, and rotating obstacles all come from this one component. The Rotating component panel in the Uni editor Image The Rotating component panel in the Object editor. caption
How to Access
Select an object, open the Properties Panel, then press the Add Component button at the bottom and pick Rotating. The component stacks onto the object as a new accordion of properties. How to Access - Add Component in the Properties Panel
Another Way to Access
Shortcut: open the Asset Panel, go to the Device tab, Basic category, and click the Rotating block. The editor spawns a cube with Rotating already attached, ready to adjust. How to Access - the Rotating block in Asset Panel > Device > Basic
Properties
Angle Float The target angle of the rotation in degrees. Speed How fast the object turns, in degrees per second. Axis Enum The axis the object spins around: X, Y, or Z. Clockwise Bool When on, the spin goes clockwise instead of counter-clockwise. Rotate Center Button A quick way to set the pivot point the object rotates around. Mode Once stops after reaching the angle. Pingpong spins back the other way and keeps oscillating. Loop jumps back to the starting angle and repeats. Auto Move Starts the rotation automatically when the game begins. Stay Time A pause after each spin before the next one starts. Property Type Description Every property on the Rotating component.
Events
Rotating has no events.
Commands
Move Starts or resumes the spin. None Pause Stops the object mid-rotation. Reset Snaps the object back to its starting angle and stops. Return Rotates the object back to the start and stops there. Command Description Parameter Commands that drive the component from a script.
Example
A simple snippet showing Rotating performing its function. Rotating - simple example