Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How could I make my object go lower in the scene using its physics properties(Js)?

Discussion in 'Scripting' started by Richard9699, Apr 26, 2017.

  1. Richard9699

    Richard9699

    Joined:
    Nov 10, 2015
    Posts:
    11
    Hi. I have an object in my scene(a bullet)and I wanted to make it go lower in the scene. I know how to do it,but only this way:
    transform.Translate(0,-5,0);
    But I wanted to make it accessing the bullet´s physics(which by the way is a rigid body physic). Oh,and sorry for my english
     
  2. SGM3

    SGM3

    Joined:
    Jun 10, 2013
    Posts:
    81
    By lower do you mean fall toward the ground over time? If your bullet is using a rigidbody, just check the gravity box. Play with the drag value.

    However, if you are going to move rigidbody's via Translate weird things will happen.
     
    Last edited: Apr 27, 2017
  3. Richard9699

    Richard9699

    Joined:
    Nov 10, 2015
    Posts:
    11
    Hi SGM3,thanks a lot for replying. Yes that's exactly what I meant,but I wanted to do it through coding,more specifically in Javascript language
     
  4. SGM3

    SGM3

    Joined:
    Jun 10, 2013
    Posts:
    81
    Last edited: Apr 27, 2017