Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Footurist | |
Old Version | Published before Godot 3 was released. |
Hello,
I picked up learning Godot 2 days ago and now I encountered the first problem I couldn’t solve on my own:
A small lower part of a circular RigidBody2d
ball shortly penetrates a StaticBody2D
ground, when falling onto it, like the edge of the ground wouldn’t stop it correctly.
Does anybody know the cause of this? I considered using _fixed_process
to avoid this, but I thought it must be possible with the physics engine. GravityScale on the ball is set to 20 and vertical linear dumping to 0.5.
I am using Godot 3.0 RC1.
Thanks alot!
Greetings, Footurist
EDIT:
So, I just tried to use RigidBody2D.set_linear_velocity(Vector2(0, 0))
in _process(delta)
but not even that could prevent this.
you should use _fixed_process
(godot2) or _physics_process
(godot3) to handle physics.
volzhs | 2018-01-22 18:13
Thanks for you answer.
So, it is normal for a RigidBody2D to act like that, when it falls into a StaticBody2D?
Because I tried both setting its linear velocity to zero on _physics_process
and on _body_shape_entered
. Nothing changes. The dipping happens mostly from great heights and only occasionally. It’s as though the ground gets broken sometimes (to visualize what’s wrong).
The thing happens on the scene “game” when letting the ball fall from the top of the screen a few times.
This is for practise, I am not trying to copy other apps for commercial purposes.
Footurist | 2018-01-22 19:04
if your staticbody2d has really thin shape, it could be.
try Continuous Cd
option ON
of rigidbody.
volzhs | 2018-01-22 19:17
Hey, volzhs
If you have time, you could take a look at the project in the link above. However, I tried Continuous Cd
aswell, both with ray or shape casting. Still happens after some time.
Footurist | 2018-01-22 19:20
I downloaded your project and run.
clicking play button does nothing. what should I look at?
volzhs | 2018-01-22 19:21
The scenes are not connected yet. You can run the scene “game” independently via the play scene button. You’ll find the scene in the folder “game” in the resource directory.
Footurist | 2018-01-22 19:23