Answers for "Rigidbody.addforce"

C#
11

Rigidbody.addforce

using UnityEngine;public class ExampleClass : MonoBehaviour
{
    public float thrust = 1.0f;
    public Rigidbody rb;    void Start()
    {
        rb = GetComponent<Rigidbody>();
        rb.AddForce(0, 0, thrust, ForceMode.Impulse);
    }
}
Posted by: Guest on February-09-2020
7

unity rigidbody addforce

rb = GetComponent<Rigidbody>();
rb.AddForce(new Vector3(1.5f,1.5f,1.5f));
Posted by: Guest on February-15-2020

Code answers related to "Rigidbody.addforce"

C# Answers by Framework

Browse Popular Code Answers by Language