Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: WasedLife on February 06, 2022, 12:18:40 PM

Title: Falling through colider when flip
Post by: WasedLife on February 06, 2022, 12:18:40 PM
Hello,
im making a motorike 2D game. I have polygon collider 2d on terrain, 2d circle collider on wheels of motorbike and when I press a key, the motorbike Flips.

The problem I am facing now is, that the moto tends to fall through the collider when I flip it (see in link).  Do you have any idea how this could be fixed? :(
https://gfycat.com/firstquestionabledingo

(I use Get button down and set scale to 1 / -1 to flip).

Ty for any help

Title: Re: Falling through colider when flip
Post by: djaydino on February 06, 2022, 08:22:17 PM
Hi.
i can see that the center of you flip is off, therefore it flips with the circle more than 50% inside the collider.

Some solutions are, right after flip, check with a overlap circle action, a little smaller than the wheel if its inside the floor, if so, move the wheel up a little (Sample : Get Position Y / add 0.3 / Set Position Y) then test again.
if not inside, continue.

adjusting the pivot for the pivot can also help so that the wheels stay around the same position.