This node can determine the distance of two objects, or their difference in angle. It can also compare two objects and tell if they're the same.
Execute | Executes the node |
↳ On Start | Executes the node at the start of the game |
↳ Always | Executes the node continously, in every frame |
Enabled | Enables the node. Disabled nodes can't be executed |
Object A | Set the first target object for the node |
Object B | Set the second target object for the node |
Operator | Select the operation that will be performed. See below for details |
Output | Sends the result of the object math operation to other nodes |
This will calculate the distance between the two objects.
An object's position is calculated from its center. As a result, when two objects are touching, the distance between them is still above 0.
When this operation is selected, the distance of the two objects is measured from Object A, on its local X axis. As a result, if Object B is on the right side of Object A, the distance is positive. If Object B is on the left side, the result is a negative value.
The distance between two objects is measured from Object A, on its local Y axis. If Object B is on top of Object A, the value is a positive value.
The distance between the target objects is measured from Object A, on its local Z axis. If Object B is in front of Object A on Z axis, the result is a positive value.
This operation involves only Object A. The result is a direction vector that is relative to the object's orientation and points to right.
Operation involves only Object A. The result is a direction vector that is relative to the object's orientation and points up.
Operation involves only Object A. The result is a direction vector that is relative to the object's orientation and points forward.
The result of this operation is the difference in angle between Objects A and B, in degrees (3d vector). You can this operation to find the absolute rotation of an object, like in this example hype:
The operation compares the target objects and return 1 (true) if they are the same object, or 0 (false) if they are different objects.
Here's a link to a demo that shows how to use the Object Math Operator node: