There’s not really a good easy way to do this. The easiest way is to use a timer or to check the current height of your player. But both are not ideal in all situations.
A more advanced option is to use a raycast to see if it can detect ground or not.
genre
October 8, 2021, 8:08pm
25
i need help fixing the jumping mechanism i keep slowly falling and infinite jumping here is the code i used
genre:
i keep slowly falling
It’s not something that can be fixed. You have to adjust the rigidbody values to get the best result. Please check my own topic about it.
I had the idea to see if I can use physics for my game. I started with the settings as below.
[image]
Here I run into the problem that the player is sliding slightly. Setting the Linear Damping to 1 solves this, but then the player doesn’t fall down anymore.
Also I like to know how to check the current velocity, because probably it could be a solution to adjust the settings at runtime. I thought I could do something like below, but it looks like thats not the case.
console.log(this.entity.ri…