Hello community!
I’m having some trouble getting a rigidbody to move on a keypress. Originally I was using translateLocal, but once I decided to change the jumping mechanics to raycasting, I had to change the entity to a dynamic rigidbody. Right now, the code looks essentially like this:
I would try to check if your move function received the correct information. You can add something like below and use the console of your browser to read the information.
console.log(dz);
Also check the rigidbody sittings of the entity. For example if Linear Damping is set to 1, the rigidbody won’t move.
It looks like it’s recieving the correct information, and both linear and angular dampening were set to zero. I tried doing this, and it returned “move() failed”:
this.jumpForce is set to 1000. The program is registering the keypresses, sending information to correct recipients, but something about the applyForce() and applyImpulse() functions aren’t working correctly, because when I change them to translateLocal() or rigidbody.teleport(), it works fine.