Rotate to Object

Description

The Rotate to Object behavior will rotate the selected object to face another selected object. 

This behavior will trigger an event on completion.

 

Properties

Triggers on Completion

Object A

This is the object that will rotate. The "front" of the object is the right face, you can change this by moving the anchor/target to another side when selecting the object. By default the current object is selected, but you can tap the graphic and choose any other object in your scene.

Object B

This is the object that Object A will rotate towards. By default the current object is selected, but you can tap the graphic and choose any other object in your scene.

Anchor

The anchor for Object A identifies the "front" of the object, and for Object B it is the offset, of where it will rotate to. You can enter the coordinates manually, or choose them visually by moving the blue anchor when selecting your object.

Effect

The effect used for the motion tween animation if the duration is greater than 0.

Set Rotary Limit

This Toggle is where or not there is a maximum amount that Object A can rotate. If the toggle is off, the object will rotate freely until it faces Object B. If the toggle is on, it will rotate as close as it is allowed before stopping.

 

Min: Minimum angle that the object can rotate

Max: The maximum angle that the object can rotate.

Duration

How long it will take for the object to rotate to the specified angle.

 

Outputs

Object A ID

This outputs the Object ID of Object A.

Object B ID

This outputs the Object ID of Object B.

 

Examples

Use this behavior if you want an object to face another object in the scene. This is often useful if you want an enemy to always look at the player.

 

Related

Get Rotation

Lock Rotation

Rotate By

Rotate to Angle

 

RotateToObjectReference.gif

0 Comments

Article is closed for comments.