Answers for "drag rigidbody2d unity3d"

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

C# Answers by Framework

Browse Popular Code Answers by Language