Hello everyone.
Here is my scene i have two objects (obj1 and obj2).
Here is a photo of the scene
So obj1 rotation is always like obj2.
And i want to change obj1 position so it be on the top of obj2 and here is the script that i used.
Vector3 wantedPosition;
wantedPosition = target.position;
wantedPosition.y = wantedPosition.y + 2;
transform.position = wantedPosition;
but it didn’t do what i want and here is what this script did photo 2
and i want something like this photo 3
Thanks for any help.