How to move object a from in front of object b to in front of object c and transfer orientation?
Learning vector arithmetic... I have two fixed cubes in my scene. Each cube has a different position and orientation ( Rotations ). I have a cylinder 1.5 units from the center of the first cube's front Z axis face.
I would like to place the cylinder in front of the second cube's Z axis at the same distance and with the same orientation that it currently has in front of the first cube.
Obviously something like:
Cylinder.transform.position=Cylinder.transform.position - CubeA.transform.position + CubeA.transform.position;
Won't to do the trick...
Some examples or pointers to resources would be appreciated.
Comment
Your answer
Follow this Question
Related Questions
Destroy object on click? UNITY 2 Answers
Moving hand with coordinates from file 0 Answers
Some coding help needed 1 Answer
Raycast does not extend beyond the object it was called in? 1 Answer
Object moving problem 0 Answers