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

Prevent wall stick when only partially against a wall #63

Open
alec-chan opened this issue Feb 23, 2017 · 2 comments
Open

Prevent wall stick when only partially against a wall #63

alec-chan opened this issue Feb 23, 2017 · 2 comments

Comments

@alec-chan
Copy link

I need some help with modifying the motor code to prevent a character from being only partially stuck to the wall. Ideally, the entire side of the box collider of the character would have to be contacting the wall in order for the player to stick, otherwise they would just fall.

Here's an example of what I'm talking about.

image

I guess the method to modify would probably be private CollidedSurface CheckSurroundings(bool forceCheck) but honestly that code is kind of daunting and its tough for me to step through and see what's going on. I'll start taking a deeper look at it tomorrow, but help would be greatly appreciated.

@cjddmut
Copy link
Owner

cjddmut commented Apr 10, 2017

A delayed response but you'll need to change how the motor does its ray casts. Right it'll cast the whole side and you'll want it to cast top and bottom and confirm both are true.

@alec-chan
Copy link
Author

@cjddmut thank you for the response!
So am I correct that I would just have to change the logic from if top or bottom is true then stick to if top and bottom are true then stick?

Any idea what part of the code that I'll have to modify to change this? I'm having trouble finding the method where raycasts are performed.

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

2 participants