Hi,
I have a scene that contains a main camera rotated with Z=27 and many ROADS, Above the ROAD we have an obstacle the view is like the image :
Obstacle Holder Script :
public class ObstacleHolder : MonoBehaviour
{
public Vector3 transformPosition;
void Update()
{
transform.position = transformPosition;
}
}
I noticed that when i change the transform.position.x the obstacle moves horizontal on the x axis like the green axis image and the x and y of the transform.localposition change to make the obstacle move inside the roads can any one explain me why transform.position move like the green image and localposition move like the red image ?
I would like to understand more what is transform.position and transform.localposition in this case.
I know that :
Transform.position is The position of the transform in world space.
Transform.localPosition is Position of the transform relative to the parent transform.
but i don’t understand what does it mean in this example i am confusing with that
the project is here