Answers for "Unity make a homing object"

C#
0

Unity make a homing object

Vector2 direction = (Vector2)Target.position - rb.position;
        direction.Normalize();
        float RotateAmount = Vector3.Cross(direction, transform.up).z;
        rb.angularVelocity = -RotateSpeed * RotateAmount;
        rb.velocity = transform.up * Speed;
Posted by: Guest on January-01-2021

C# Answers by Framework

Browse Popular Code Answers by Language