2016-05-15 10 views

Antwort

2

Wollen Sie das tun?

enter image description here

Wenn ja dann ist es ziemlich einfach - Sie stellen den Vorwärtsvektor von A auf den Vektor von P1 nach P2.

public class Rotate : MonoBehaviour 
{ 
    public Transform P1; 
    public Transform P2; 

    void Update() 
    { 
     transform.forward = P2.position - P1.position; 
    } 
} 
0

Nr. stattdessen, es zu benutzen.

 Quaternion rot = Quaternion.FromToRotation(Vector3.up, boundPoint4 - boundPoint3); 
     this.TileCollider.transform.rotation = new Quaternion(-1 * rot.x, rot.y, rot.z, rot.w); 
Verwandte Themen