align object with collision normal then look at an object on one axis
Hello everyone, I am trying to align an object with another object normal when colliding, this part work juste fine. but then i need to make it look at another object on only one axis. heres my code for the moment.
ContactPoint contact = colid.contacts[0];
Quaternion rot = Quaternion.FromToRotation(Vector3.up, contact.normal);
Vector3 pos = contact.point;
transform.position = pos + transform.up ;
transform.rotation = rot;
// then rotate to face another object but only on its Y axis
Note: the object can be in various angle after it is adjusted with the normal of the object.
Comment
Your answer
Follow this Question
Related Questions
Align a plane with 3 normal 1 Answer
Face object top to camera or Keep current top with LookAt 0 Answers
Turret rotating on a z axis 2 Answers
How can I make my game object move like this? 0 Answers
3 Axis Camera Rotation 0 Answers