Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Corruptinator | |
Old Version | Published before Godot 3 was released. |
This might be vague to ask but, does anybody know how to make a 2D kinematic body stick to the wall and move in a direction depending if the wall/floor is Horizontal, Vertical, or Angled; similar to how the the SpiderBall Ability or the Geemer Mechanics work?
I can only think of two possible pseudo-code theories on how this works…
[Ideal/effective method]
- When it makes contact with a platform or surface it detects which angle it is touching upon, next it would tell the gravity to make the object move towards the contact coordinates that the collision detection is saying from its x and y axis.
[Easier/lazy method]
2) Simple, using navigation points to tell the object which way to go.
I prefer method 1 better, but I’d like to hear what works best to make the wall-stick movement mechanic works code-wise.
You may want relative movement, is just matter of checking collision normal to adjust it.
Also, if you think the lazy method can be done faster for you, go for it, you can change it later for a better one
eons | 2016-10-13 14:59