Search Unity

How to apply a specific amount of force to a ball that it stops at a given point?

Discussion in 'Physics' started by Th1nk3r, Jul 10, 2020.

  1. Th1nk3r

    Th1nk3r

    Joined:
    Jun 21, 2020
    Posts:
    4
    I have an aiming circle and a ball at a given starting point. How to apply a force to a ball that it rolls and stops at the center of the circle (because of drag and friction)?
     
  2. AlTheSlacker

    AlTheSlacker

    Joined:
    Jun 12, 2017
    Posts:
    326
    There are a few options, have a read of these:

    https://forum.unity.com/threads/how-to-calculate-drag-force.628570/
    Describes a similar problem and gives the drag equation.

    https://en.wikipedia.org/wiki/Equations_of_motion
    Allows you to understand the distance, time, velocity, acceleration relationship. Scroll down to the bit "
    Constant translational acceleration in a straight line".

    Force = mass x acceleration lets you work out the force to apply (the time will be the fixed physics time step)

    You may want to remove drag from the rigidbody and code your own in FixedUpdate for the body to give yourself more control.