Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

adding force to rigidbodys in unityu code example

Example 1: 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);
    }
}

Example 2: unity rigidbody addforce

rb = GetComponent<Rigidbody>();
rb.AddForce(new Vector3(1.5f,1.5f,1.5f));

Tags:

Csharp Example

Related

php sql statements code example ajax properties code example bootstrap toast dynamic code example how to create objects in php code example cbootstrap colors code example how to delete a folder in the terminal code example how to display a webpage with html parser python code example error 1045 access denied for user 'root'@'localhost' code example performance testing features code example web scrape node js code example python json object get value code example grep command to find a file code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy