object.copy_rotation_from
Rotate one object to match another.
Arguments
- other
The object whose rotation should be copied.
- all_axes
A boolean indicating whether to copy all of the other object's axes of rotation (true) or just its heading (false).
Example
global.object[0].copy_rotation_from(global.object[1], true)
Notes
Passing true as the boolean argument will perform the rotation without doing any further collision checking or physics. If the object being rotated is physics-simulated, and the rotation causes the object to clip into something else, then it may end up being launched away if something bumps it and updates its physics simulation.
This function can fail to do anything if it is called on an object that is attached to something else.