[SOVLED] My raycast script for jump isn't working

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

1 Like

I’m not sure how your boolean exactly works, but shouldn’t this.jumping.state on line 109 be set to true?

1 Like

Thanks @Albertos! I also changed it so that the RaycastPlayerBase entity is below the player to stop it from finding itself.

1 Like