Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on November 21, 2017, 09:05:42 AM

Title: Player bouncing on top of the ladder [SOLVED]
Post by: Rabagast on November 21, 2017, 09:05:42 AM
Hi!

Is there a way to avoid the player bouncing or jumping on the top of the ladder after he is finish climbing? Please watch the video so you can see if you don't understand exactly what I mean.

In a very old platformer I was working on, I fixed this to just turn on kinematic on the player when he is on the top of the ladder and turn it off again when I move the player left or right. That was with Unity 5.4.1, but after Unity 5.5.0, they did some changes on Rigidbody 2D, so I got a lot of problems with this.

I have tried a lot of things already and nothing works properly, so I don't know how to solve it. Please give me suggestions I can try. :)

https://www.youtube.com/watch?v=wAImvHpaLOc&feature=youtu.be (https://www.youtube.com/watch?v=wAImvHpaLOc&feature=youtu.be)
Title: Re: Player bouncing on top of the ladder
Post by: djaydino on November 21, 2017, 11:42:49 AM
Hi,
Maybe some gravity settings  when close to the top.

Can you pm me a sample scene, so i know your setup and can try to find a solution.

Title: Re: Player bouncing on top of the ladder
Post by: Rabagast on November 21, 2017, 04:30:51 PM
Hi, djaydino!

Thank you! I will pm you a sample scene in a few minutes. :)
Title: Re: Player bouncing on top of the ladder
Post by: Rabagast on November 21, 2017, 04:36:43 PM
Quote
Can you pm me a sample scene, so i know your setup and can try to find a solution.

Now you can check your mail. :)
Title: Re: Player bouncing on top of the ladder
Post by: Rabagast on November 21, 2017, 04:43:28 PM
I couldn't send you any file as a pm, so I send it here. :)
Title: Re: Player bouncing on top of the ladder
Post by: djaydino on November 22, 2017, 06:39:04 AM
Hi, i tested a little and i think this is ok :

i made a sprite from the ladder and placed this above the ladder with a box collider 2d (disabled) and turned off the sprite renderer.

Then on the ladder fsm in the on ladder state i use the custom action Enable Collider 2D to enable the collider and in the wait(Ofll Ladder) state i disable the collider.
And also on the jump fsm on the do jump state i have a Enable Collider 2D to disable the collider.

If you have several ladders drop all the colliders as a child and use Incl Children.

(https://i.imgur.com/t5vx5ry.gif)
Title: Re: Player bouncing on top of the ladder
Post by: Rabagast on November 22, 2017, 05:13:34 PM
Quote
Hi, i tested a little and i think this is ok :

i made a sprite from the ladder and placed this above the ladder with a box collider 2d (disabled) and turned off the sprite renderer.

Then on the ladder fsm in the on ladder state i use the custom action Enable Collider 2D to enable the collider and in the wait(Ofll Ladder) state i disable the collider.
And also on the jump fsm on the do jump state i have a Enable Collider 2D to disable the collider.

If you have several ladders drop all the colliders as a child and use Incl Children.

Hi!
Thank you. I was thinking of to use colliders like this, but I didn't know about Enable Collider 2D. Very useful. But since I use a tilemap editor and all the ladders are tile-based, I don't have all the colliders as childs of a folder, but then I discovered Enable Collider 2D With Tag, so all the colliders will enable and disable at the same time. It works very well...in the editor, but...can you try to make a build of the ladder sample scene I sent you, after you made the changes? Because it doesn't work in the build. I don't know if it's because of the changes I did. But in the Ladder Raycast FSM, it doesn't go to the state "Up -> Down Disable Collider" when I climb down from the top of the ladder. It works only in the editor. Not in the build

Take a look at this video:

Title: Re: Player bouncing on top of the ladder
Post by: Rabagast on November 23, 2017, 01:55:36 AM
I found the problem. You need to set the collider to ignore raycast. I think on the FSM Ladder Raycast, the Raycast hits the collider in the build, but not in the editor. It works fine now. :) Just some few other bugs I need to fix with the animation.

Thanks for your help djaydino! :)
Title: Re: Player bouncing on top of the ladder
Post by: djaydino on November 23, 2017, 03:27:42 AM
Hi.
No problem, happy to help :D
Title: Re: Player bouncing on top of the ladder [SOLVED]
Post by: Rabagast on November 24, 2017, 03:06:39 AM
I just have one other question. It's the almost the same thing, so I post it here instead of creating a new topic. :)

Is it a way to avoid the player to slide down on a slope?
See the video.

Title: Re: Player bouncing on top of the ladder [SOLVED]
Post by: AlexandrVol on February 06, 2024, 07:40:32 PM
By the way, a little off topic, but if anyone was interested, you can buy Palworld (https://ggsel.net/catalog/palworld) and play already, while the discounts on the game are still relevant)