Search Unity

Adding force/velocity that causes the body to arrive at point B in X seconds?

Discussion in 'Physics' started by DearUnityPleaseAddSerializableDictionaries, Mar 11, 2019.

  1. DearUnityPleaseAddSerializableDictionaries

    DearUnityPleaseAddSerializableDictionaries

    Joined:
    Sep 12, 2014
    Posts:
    135
    I have a RigidBody, maybe a dynamic body?

    You see, I have a point B.

    Currently, my object, is at point A.

    I want to have my object get from point B to point A in exactly 4 seconds.

    How do I do that?

    If I use a tween (e.g. DoTween), the problem becomes trivial (i.e. lerping between point A to point B) - is this a good solution? I would have a kinematic RigidBody in that case, or is this inefficient?

    I would be having 10-20 of these objects simultaneously.
     
  2. Deleted User

    Deleted User

    Guest

    The best way to know would be trying and see:
    1. if it actually works,
    2. how much strain all 20 objects moving at the save time would cause to your system.
     
  3. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    In "cost" terms its not really a problem, unless they are moving thourgh a sea of rigidbodies.

    Question is, does having said object kinametic okay for the gameplay.