E) RigidBody.Velocity

Aus hyperdramatik
Version vom 23. Oktober 2019, 14:55 Uhr von TomasM (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „'''E) RigidBody.Velocity''' The velocity vector of the rigidbody. It represents the rate of change of the Rigidbody position. public class RigidBodySetVeloc…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

E) RigidBody.Velocity

The velocity vector of the rigidbody. It represents the rate of change of the Rigidbody position.

public class RigidBodySetVelocity : MonoBehaviour
{
   public float forceMult = 200;
   private Rigidbody rb;

   private void Awake()
   {
       rb = GetComponent<Rigidbody>();
   }

   // Update is called once per frame
   private void Update()
   {
       rb.velocity = transform.forward * Time.deltaTime * forceMult;
   }