Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving platform and problems getting stuck at slopes #52

Open
jraicr opened this issue Apr 12, 2016 · 8 comments
Open

Moving platform and problems getting stuck at slopes #52

jraicr opened this issue Apr 12, 2016 · 8 comments

Comments

@jraicr
Copy link

jraicr commented Apr 12, 2016

When the motor have available the moving platform option, assigning a layer mask to it, the player get stucked when trying to get up/down slopes. Everything works fine with the slopes when no layer mask is assigned.

@cjddmut
Copy link
Owner

cjddmut commented Apr 12, 2016

I'll try to take a look this weekend.

@willjones1
Copy link

Moving minimum distance from environment up to .1 solves the sticking, but introduces some glide.

@pixellykyle
Copy link

I had a similar issue but changing it to 0.55 improved things greatly and has (I hope) fixed the issue I had of the main character dropping through one way platforms too.

@ezubiria
Copy link

ezubiria commented Nov 9, 2017

First of all thank you for this amazing library!

Any news on this issue?

I've been looking the code and I think that there is some bug in PlatformerMotor2D.CheckSurroundings() but I'm not sure... Is this possible?

To avoid this issue I did a workaround that adds/removes the moving platform layer to the variable "Moving Platforms Layer" when the player approaches to the moving platform. I used an additional collider object to trigger that. It isn't the most elegant way but it works fine.

@cjddmut
Copy link
Owner

cjddmut commented Nov 11, 2017

No news on the issue, been slammed with other projects and haven't been able to look at this one.

Definitely possible there's a bug in PlatformerMotor2D.CheckSurroundings() :)

@AlexAdvani
Copy link

AlexAdvani commented Mar 15, 2018

I think I may have fixed the problem. The line that is causing all of this is in UpdateMovingPlatform() on line 1741. Replace _collisionMask with movingPlatformLayerMask. I think the motor was detecting the static environment and caused the problem with SeparateFromEnvironment() being triggered wrongly.

I hope this helps as i have been banging my head against the issue for over a year on and off. I was even convinced that I would have to specifically design around having either slopes or moving platforms.

@GalacticGUI
Copy link

While I haven't tested this thoroughly, it seems to have fixed the issue I was having:
Once I implemented moving platforms, my player was getting randomly stuck in slopes he jumped into, whether above or below.
The only workaround I had was to set Minimum Distance from Environment as low as it would let me and that was about 97% effective.
After changing the line of code you suggested, I put Minimum Distance from Environment back to its default setting (0.1) and tried to get stuck in a slope and after about 10 minutes of bouncing around I haven't gotten stuck once.
It probably needs more testing before closing the issue but preliminary tests look good in my case.

Last but not least, thanks for the awesome character controller.

@AlexAdvani
Copy link

Glad to hear this seems to be on the right track. 👍 I imagine this needs to be tested a bunch more before I'm satisfied that it's a solution but otherwise I haven't gotten stuck yet after a week of playtesting with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants