playMaker

Author Topic: Jump with raycasting [SOLVED]  (Read 1967 times)

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Jump with raycasting [SOLVED]
« on: February 22, 2014, 11:49:43 AM »
Hi,

I have setup an FSM called Jump Manager (screenshot). Basically im trying to make the player jump by pressing the space bar.

1. Player presses Jump (space key) from player FSM
2. Send Event to FSM called 'jump manager'
3. Listen event
4. Raycast to see if player is touching ground
5. Jump event
6. Delay 1 sec whilst player is in the air (just so next raycast doesnt start before lift off)
7. Raycast to see if player is touching ground
8. Send event back to player FSM

The solution above works, however, the problem is when i test, the player jumps smoothly up and down until like the 4th jump it doesn't carry on working like before. It just delays a bit longer when touching the ground. Causing it to not jump straight away again?

Not sure what's causing this? or is there another way using a similar method.

Thanks

Nick
« Last Edit: February 24, 2014, 06:26:53 PM by coxy17 »

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Jump with raycasting
« Reply #1 on: February 24, 2014, 06:26:01 PM »
Doesnt matter, found out I just had to adjust the timing of the delay state.