I made a raycast script for my FPS game for jumping and it woks fine except the fact that I can jump infinitely. I thought raycasts could already stop infinitely jumping.
Could somebody please fix my first-person-movement code?
My Project Link: https://playcanvas.com/project/1276292/overview/fps-game
I’m not sure how your boolean exactly works, but shouldn’t this.jumping.state on line 109 be set to true?
this.jumping.state
true
Thanks @Albertos! I also changed it so that the RaycastPlayerBase entity is below the player to stop it from finding itself.