I’ve tried many different types of movement on my script, and yet addforce doesn’t work while the object has movement. I tried disabling the movement directly in the script putting everything in comment (/*) and then it worked. Any thoughts on why this isn’t working?
You are imposing the velocity of the rigidbody (rigid.velocity). Applying forces don’t have any effect because you’re setting back the imposed velocity each frame.
I found a way to bipass the velocity thing, what i had to do was put the trigger in the same void that the velocity is, and put it before the velocity. But that only fixes the the y-axis, so i can jump normally, but if i try to addforce ona different axis, it keeps not working. Any ideia of why that happens?
Do not set rigidbody.velocity directly. Whenever you need to modify the velocity, use AddForce with ForceMode.VelocityChange. You should read the actual velocity (rigid.velocity), then calculate the velocity diff for reaching the desired velocity, and apply that velocity diff with AddForce(diff, ForceMode.VelocityChange).