0

I have a node called "SlidingBlock" which is a RigidBody2D, its mode is Character so I can move it with the physics engine but not rotate it. It also has a CollisionShape2D.

I've programmed a kicking action on which I set a value for its linear velocity, like this:

block_touched.linear_velocity.x = BLOCK_SPEED

The block moves until it collides with another RigidBody2D which is in mode Static and, when it collides, it goes one pixel forward and then back. It looks weird in my game which is a somewhat low resolution pixel art game.

I tried creating a Physics Material with Bounce set to 0 with no success. How can I achieve a collision with absolutely no bounce effect?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Telmo Trooper
  • 4,993
  • 1
  • 30
  • 35
  • 1
    This is a known bug, see https://github.com/godotengine/godot/issues/16505. – Calinou May 07 '20 at 07:02
  • @Calinou Is there a workaround for it? – Telmo Trooper May 07 '20 at 12:18
  • Godot still lets you pick between Godot's Physics and Bullet Physics, maybe try switching and see what happens? There's a good chance it still won't work, but it's worth a shot. – Christopher Bennett May 07 '20 at 13:30
  • @ChristopherBennett Googling it now it seems the Bullet physics backend is only available for 3D, which won't help me here. ️ – Telmo Trooper May 07 '20 at 14:08
  • Sorry, my bad. I've been doing all my work in 3D recently, so i'm thinking in 3D. Do you have contact monitoring turned on for the rigidbody? – Christopher Bennett May 07 '20 at 14:23
  • Yes, Contact Monitor is set to "On" and Contacts Reported set to "1", though I don't quite get how these work yet. I'll give a more thorough look into the docs. – Telmo Trooper May 07 '20 at 14:31
  • Yeah, that might be something to look at. Only other thing I can think is to put all the movement logic in `_physics_process()` instead of `_process()`. – Christopher Bennett May 07 '20 at 14:39
  • Sorry, also try enabling continuous detection (CD) on the RigidBody, and set it to "cast shape". – Christopher Bennett May 07 '20 at 14:47
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/213340/discussion-between-telmo-trooper-and-christopher-bennett). – Telmo Trooper May 07 '20 at 14:52
  • "cast shape" has never really worked to remove the bounce for me. I have had better luck turning up ProjectSettings > General > Physics > Common > Physics Fps. I have mine set to 120. I keep an inverse constant of that value around so I can multiply it against my forces to keep them around the same strength. You will still get bounce, but it seems dampened. Hope they fix it soon... – Cory-G Jun 20 '20 at 23:06

0 Answers0