top of page

指定したオブジェクトを向く

    public Transform Target;
    public float Speed = 0.1f;

    void Update ()
    {
        transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.LookRotation (Target.position- transform.position),Speed);
    }

 

bottom of page