Search Unity

rb.addforce question

Discussion in 'Scripting' started by Nagamorii, Mar 21, 2019.

  1. Nagamorii

    Nagamorii

    Joined:
    Mar 20, 2019
    Posts:
    2
    how can i continually adding force to my player every second? Even if i put the script into void Update instead of Void FixedUpdate the velocity remains the same.



    void Update()



    {



    rb.AddForce(0, 0, forwardForce * Time.deltaTime);



    }
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    What value is your forwardForce?
     
  3. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Maybe the object has a high drag and its reaching its terminal velocity in less than a second? (unlikly though)

    Try debuging the velocity itself(printing it to the console)

    Also this question should be in the physics forum, and please use the code tags.
     
    Antypodish likes this.