Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: IK72 on September 12, 2020, 03:36:40 AM

Title: Problems with raycast and jumping.
Post by: IK72 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?
Title: Re: Problems with raycast and jumping.
Post by: hoyoyo80 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
Title: Re: Problems with raycast and jumping.
Post by: djaydino 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 (https://hutonggames.fogbugz.com/default.asp?W1181)) to check.