Coder Social home page Coder Social logo

Comments (8)

AlexAdvani avatar AlexAdvani commented on August 20, 2024 5

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.

from unity-2d-platformer-controller.

cjddmut avatar cjddmut commented on August 20, 2024

I'll try to take a look this weekend.

from unity-2d-platformer-controller.

willjones1 avatar willjones1 commented on August 20, 2024

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

from unity-2d-platformer-controller.

pixellykyle avatar pixellykyle commented on August 20, 2024

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.

from unity-2d-platformer-controller.

ezubiria avatar ezubiria commented on August 20, 2024

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.

from unity-2d-platformer-controller.

cjddmut avatar cjddmut commented on August 20, 2024

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() :)

from unity-2d-platformer-controller.

GalacticGUI avatar GalacticGUI commented on August 20, 2024

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.

from unity-2d-platformer-controller.

AlexAdvani avatar AlexAdvani commented on August 20, 2024

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

from unity-2d-platformer-controller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.