Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: coxy17 on September 26, 2014, 10:27:18 AM

Title: Platform jump issue [SOLVED]
Post by: coxy17 on September 26, 2014, 10:27:18 AM
Hi, I have a platformer game where the player is able to jump from one platform to another (3D game) and im having no issue with the jump its just my setup as caused the following issue.

First i need to explain my basic setup (so ive drawn a diagram) and ill reference this below

I have a static platform with invisible walls (used to prevent player falling off sides) this is just a thin invisible wall with collision enabled. Not sure if this is the best method.

The problem im having (also mentioned in the drawing) is when the player jumps as the moving platform is moving side to side. This sometimes causes the player to not land directly between the invisible walls (causes a collision with the thin edges of the wall). How can i avoid this happening but keep my walls intact?



I have realised now that i might need to rethink on how i prevent the player from falling off the edges of the platform? as i think a invisible wall (with collision on) is not going to be the best method now? as this is always enabled.
Title: Re: Platform jump issue
Post by: TrentSterling on September 26, 2014, 02:40:52 PM
It's a weird problem to have. Are the invisible walls totally needed?

Anyway, a quick fix would be to change your player's collision layer when he's airborne.

If he's in the air, assign a collision layer that ignores invisible walls. When he lands on the floor, set his layer to something that obeys the walls.
Title: Re: Platform jump issue
Post by: coxy17 on September 26, 2014, 05:20:41 PM
Yes its totally strange looking at the example doesnt do justice to the overall concept. But I dont really want to have invisible walls if I can think of a clever way to stop my player from falling off certain sides of a platform.

Ill have a go at the layer change idea, but I think ive reached a dilemma. 

Cheers
Title: Re: Platform jump issue [SOLVED]
Post by: coxy17 on October 29, 2014, 07:04:43 PM
Had a play and changing the layer worked :)
Title: Re: Platform jump issue [SOLVED]
Post by: cloud03 on October 29, 2014, 08:09:14 PM
Is there a particular reason why you are using invisible wall to prevent the character falling off from the sides?

Why not restrict the Z axis on the rigidbody component?
Title: Re: Platform jump issue [SOLVED]
Post by: coxy17 on October 30, 2014, 08:18:14 PM
Yes there a reason, I need to block the player from falling off certain sides, not all. So blocking Z axis will be too complex for me. What ive done is setup the invisible walls and just have it triggerto stop the player