Hello
I have my pins in my game and i want to detect if a pin is too much on the left or too much on the right. ( basically if it overlaps a gutter )
so i wanted to check the X position of a pin.
But, i don’t understand why the X coordinnates are so different between each pins. They seem not to be into the world, but instead, each pin seems to have it’s own set of coordinnates ( changing the rotation of a pin moves it like crazy in the world )
See my screenshot for more info:
http://www.sports-games.org/myproblem.jpg ( see the weird X coordinnate behaviour )
My question is, how can i get a X coordinnate ( in world coordinnate ) that i can check against let’s say the left border of my track ?
Thank you
patricia.
The coordinates displayed are local coordinates - are the pin objects all under the same parent or do they have different parents?
Indeed all the pins are under the same parent.
Track/pin1
Track/pin2
etc…
Getting them out of the parents still cause a “problem”:
pin1 as an X from -1 to -2 if i move it laterally from edge to edge
pin2 as an X from 0 to -1
All i want is the position of the pin in the world in fact. Maybe there’s a function to convert the coordinnates ?
Patricia.
transform.position is world coordinates. transform.localPosition is relative to the parent.
–Eric
Nop, doesn’t work either, i have place 3 objets on the same X, when i print the output ( with debug.log ) , they’re all different. I even tried to output the X coordinnates of the rigid body but no luck.
I’m probably doing something wrong but i don’t know what.
Patricia.
If they are all under the same transform.parent, then, setting the same position on any of them will position them on the same place…
can you post the hierarchy and the code you use to set them in the same position ?
.ORG