Get Position

From Fancade Wiki
Revision as of 15:32, 5 September 2025 by TheRedGuy "the red guy real" (talk | contribs) (Added a folder.)
Get Position
Get Position.png
TypeScript block
ColliderNone
FolderObjects
Ports
Inputs Object
Outputs Position
Rotation

Given an object, outputs its position and rotation. Specifically, it gives the position of the object's center of mass.

Notes

If the input is unwired, output the geometric center of the object it is contained instead, or itself otherwise. The geometric center is calculated in terms of voxels instead of blocks, or in other words, the center of the most minimum rectangle that contains every voxel of said object.

Additional calculations are needed to arrive at the geometric center of an object (in terms of blocks).

Examples

You can create a floor detector using one. It is very simple, as you can use a Break Vector on the wire, use a Less Than in the top input, and set the layer to put a limit on the bottom input(Example: Number 0.9), and set a If to detect it. You can add anything that has a before, and after wires on the "True" output. (Example: Play Sound.)

Related