playMaker

Author Topic: Problems with raycast and jumping.  (Read 992 times)

IK72

  • Playmaker Newbie
  • *
  • Posts: 3
Problems with raycast and jumping.
« on: September 12, 2020, 03:36:40 AM »
I have a simple character right now (2D), that can walk left and right and can jump. Up until this point, I have been using a Collision Event to detect when the player is touching the ground, but this brings in all sorts of issues, so I need to use raycasting, but trying to get raycasting to work also seems to have issues.

I have it so that the raycast, when it hits the ground, so send the player back to the start of the FSM, but whenever the player jumps, the raycast automatically activates and gets locked in the state. Is there any way to only have it so the raycast doesn't hit it early?

hoyoyo80

  • Full Member
  • ***
  • Posts: 136
Re: Problems with raycast and jumping.
« Reply #1 on: September 13, 2020, 08:21:09 AM »
I use this method in separate FSM  just  to continuous is checking with box overlap 2d, that trigger a boolean OnGround on or off

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Problems with raycast and jumping.
« Reply #2 on: September 20, 2020, 04:24:04 AM »
Hi.
In our game we use 3 raycasts (center/left/right) and a bool any true action.
on the raycast we store the bool value for each raycast.

we also have the grounded checking in a separate fsm.

You can use 'Fsm Bool Test' (Ecosystem) to check.