#all methods called in FixedUpdate
1 messages · Page 1 of 1 (latest)
yoo
the jump movement is better with it, I use rigidbody
I will try
in jump method ?
I replace "getRigidbody2D().AddForce(newForce, ForceMode2D.Impulse);" with "rb.velocity += Vector3.up * value;" ?
yeah try it
it didn't change anything :/
Figure out if there's another function interfering with this. This is a typical debugging procedure
I will see
Just remove certain functions which you think can be having an effect
I don't understand the if(getIsJumping())
But you're setting a new velocity after that?
protected override void jump()
{
if (canJump && controller.currentInput.yMovement > 0)
{
canJump = false;
isJumping = true;
//getRigidbody2D().velocity = Vector2.zero;
//newForce.Set(0, (float)getEntityAttribute().getAttribute(SharedAttributes.JUMP_STRENGTH.getName()).getDefaultValue());
//getRigidbody2D().AddForce(newForce, ForceMode2D.Impulse);
getRigidbody2D().velocity = Vector3.up * 70;
}
}
``` no I use it here
use += not just =
Oh well seen
Did it work
I can't use += in vector
like the error mentions, you're trying to give a vector3 to a vector2
try Vector2.up instead
Yeah that's it
I was just searching if you can still do velocity += in 2d rigidbodies
Ok