Answers for "how to change the drag of a rigidbody in unity through script"

C#
0

how to change the drag of a rigidbody in unity through script

public Rigidbody rb;

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

    void OpenParachute()
    {
        rb.drag = 20;
    }

    void Update()
    {
        if (Input.GetButton("Space"))
            OpenParachute();
    }
Posted by: Guest on February-08-2021

Code answers related to "how to change the drag of a rigidbody in unity through script"

C# Answers by Framework

Browse Popular Code Answers by Language