![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Yoruichill |
I’m quite new to Godot engine and new to game development in general.
So what i’m trying to do is to make my rigidbody character stick to the wall
but i couldnt manage to do it properly i’ve tried changing its mode to static or
changing sleeping state to true when touching a wall these worked but when my rigidbody touches to the wall with high velocity it sometimes stucks inside of the wall or it bounces and freezes in mid air
basicaly what im trying to do is i have a sticky rigidbody ball and i want it stick to a surface it touches
If you want the ball to stick to any wall, you can check for wall collision in the code.
Check for whether the ball is colliding with a wall object via a body_entered
signal. When this signal is fired off, use the body
parameter of body_enteted
and the name
attribute of body
to determine whether the object is a wall. Next, assign the position of the collision point to be the current position of the ball, and turn off any other movement code. When you want to move the ball, allow the ball to move again, and reinstate the movement code.
Ertain | 2018-11-08 19:24