Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

How to increase speed of object?

Discussion in 'Scripting' started by llewellynathan, Oct 13, 2019 at 1:33 AM.

  1. llewellynathan

    llewellynathan

    Joined:
    Sep 6, 2019
    Posts:
    9
    I have a ball on a flat surface. As the surface tilts the ball rolls. How would I increase the speed of the ball if it contacts a specific point on the surface? Looking at the documentation I see there is Rigidbody.velocity but I can't find any examples of how to use it. Is Rigidbody.velocity even the right thing to use? Would addForce be better?
     
  2. WarmedxMints

    WarmedxMints

    Joined:
    Feb 6, 2017
    Posts:
    712
    It depends on how you are doing things atm. I'm guessing that you are using the physics system to move it via gravity. You could use a physics material on the surface to reduce friction. If you want it to boost the ball, then add force.