Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

RigidBody2D Add Force method works differently sometimes

Discussion in 'Editor & General Support' started by kerak19_unity, Dec 7, 2018.

  1. kerak19_unity

    kerak19_unity

    Joined:
    Nov 18, 2018
    Posts:
    2
    Hi. I've noticed, that sometimes(totally randomly) AddForce adds less force than it should, which makes my player jump lower than normally. I've debugged the parameters passed to AddForce, and they are ALWAYS the same. What kind of problem may it be?

    My AddForce invocation looks like this:
    Code (CSharp):
    1. playerRigidBody.AddForce (transform.up * jumpForce, ForceMode2D.Impulse);
    jumpForce for every AddForce invocation stays the same.

    Gif of the weird behaviour:
    upload_2018-12-7_20-56-18.gif
     
  2. kerak19_unity

    kerak19_unity

    Joined:
    Nov 18, 2018
    Posts:
    2
    Looks like Unity restart helped, case closed.