How do I get the distance to a tag/player?
It seems like there is no tool to measure a distance? (between a sensor and a tag for example)
The only thing that I found to evaluate a distance is using a trigger zone with :
-a sphere shape
-0 for the size of the sphere
-X for the fall off (diameter of the sphere)
Then, if the tag is inside the sphere, the distance should be :
X * 0.5 * (1 - "Output of the trigger")
But I only manage to get approximate measures (even with grid on).
Is this intended? Did I miss something?
-
With the trigger zone setup you are using which is one way to get a distance measurement you may be getting less accurate measurements if detecting a sculpt because it measures the point of intersection with the zone not a consistent fixed point on the sculpture e.g. its center
If you want more accurate measurements with this method the instead of detecting the sculpt use a Tag.
The other method of measuring is with two Tags. One on each object you want the distance between. Wire or transmit the 'scene space transform' output from each tag to a Calculator gadget (Palette > components > logic and processing) set to minus 1 one from the other. Wire the Calculator gadget output to a splitter Gadget (also in logic and processing). This will split the Transform into Position, Orientation and Scale. Take the Position output and that should now be giving you a distance value between the tags -
I was already using a tag but still got an error.
I'll try to quantify this error as soon as I can.
But your solution using transform is just genius. I didn't know that the transform of the object was exposed.
I'll try that.
Thank you.
الرجاء تسجيل الدخول لترك تعليق.