Use this node to calculate different values based on the distance or difference in angle between two objects in a game.
Execute | Execute the node |
↳ On Start | Execute the node at the start of the game |
↳ Always | Always execute the node, the node will execute every frame until it's disabled |
Enabled | Enable the node. Disabled it will not do anything even when executed. |
Object 1 | The first object used in the operator |
Object 2 | The second object used by the operator |
Operator | Select the operation to use (more on operations below) |
Output | Send the calculated value to other nodes |
This will calculate the distance between the two objects.
An object's position is calculated at its center so when 2 objects are touching the operator will still produce a positive value.
The distance between Object 1 and Object 2 only calculated on the X axis.
If Object 2 is behind Object 1 on the X axis the operator will produce a negative value.
The distance between object 1 and object 2 only calculated on the Y axis.
If Object 2 is behind Object 1 on the Y axis the operator will produce a negative value.
The distance between object 1 and object 2 only calculated on the Z axis.
If Object 2 is behind Object 1 on the Z axis the operator will produce a negative value.
Uses only Object 1. Outputs direction vector that points to right. Relative to object orientation.
Uses only Object 1. Outputs direction vector that points to up. Relative to object orientation.
Uses only Object 1. Outputs direction vector that points to forward. Relative to object orientation.
The difference in angle between Objects 1 & 2 in degrees (3d vector). Can be used to find the absolute rotation of an object, here's the example hype:
Returns true or false (1 or 0) based on if the objects being compared are the same object or not
Here's a link to the hype that shows how to implement and use the Object Math Operator node: