Comments (8)
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.
I'll try to take a look this weekend.
from unity-2d-platformer-controller.
Moving minimum distance from environment up to .1 solves the sticking, but introduces some glide.
from unity-2d-platformer-controller.
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.
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.
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.
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.
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)
- Prevent wall stick when only partially against a wall HOT 2
- No namespace for PlatformerMotor2D and MovingPlatformMotor2D
- Tap for small jump? HOT 1
- How I can have Touch Control? HOT 1
- AI Problems!
- Disabling and enabling the motor (with a rigidbody attached to) on a ramp makes the motor move permanently
- One Way Platform bug, when wall jumping
- Bug when double tap right arrow on small slope
- PC2D gets stuck at 45 degree angle using Polygon Collider 2D HOT 2
- Sliding down slopes while also allowing movement upward HOT 2
- Thank you!
- No slip on sloped surfaces HOT 3
- Applying a force to motor, like AddForce()
- Switch collider to capsule colllider
- Where are conrtols handled? HOT 3
- Hitch in wall interaction HOT 1
- 2D Platformer Games HOT 1
- Move Up&Down When Sticking on Wall
- Permission HOT 2
- Collision and trigger
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unity-2d-platformer-controller.