You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
When creating two StaticBody2Ds, no matter how well aligned they are, a RigidBody2D passing over them will jump upwards sometimes. I expected the RigidBody2D to just roll over the connection since there is no gap at all, but it jumps instead.
Attach the GDScript code below to a Node2D in a new project, and run:
extends Node2D
const STATIC_SIZE = 2000
onready var img = preload('res://icon.png')
func _ready():
var rb := RigidBody2D.new()
var s = Sprite.new()
s.texture = img
rb.add_child(s)
# Add a circle shaped collision
var rb_col := CollisionShape2D.new()
rb_col.shape = CircleShape2D.new()
rb_col.shape.radius = 50
rb.add_child(rb_col)
# Configure to have no friction and no damp
rb.linear_damp = 0
rb.physics_material_override = PhysicsMaterial.new()
rb.physics_material_override.friction = 0
# apply impulse
rb.apply_impulse(Vector2.ZERO, Vector2(1050, 0))
# follow with a camera
var camera := Camera2D.new()
camera.current = true
rb.add_child(camera)
add_child(rb)
# create 10 consecutive StaticBody2D perfectly aligned
var pos := Vector2(STATIC_SIZE / 2, 200)
for x in range(0, 10):
var ground := StaticBody2D.new()
var ground_col := CollisionShape2D.new()
ground_col.shape = RectangleShape2D.new()
ground_col.shape.extents = Vector2(STATIC_SIZE / 2, 100)
ground.add_child(ground_col)
# Add a sprite so we can see where the division is
s = Sprite.new()
s.position = Vector2(-STATIC_SIZE/2, -50)
s.texture = img
ground.add_child(s)
ground.position = pos
add_child(ground)
pos.x += STATIC_SIZE
The text was updated successfully, but these errors were encountered:
akien-mga
changed the title
RigidBody2D bounces when passing on top of two perfectly aligned StaticBody2Ds
[Bullet] RigidBody2D bounces when passing on top of two perfectly aligned StaticBody2Ds
May 19, 2022
Godot version:
Happens on 3.1 stable and 3.1.1rc1
OS/device including version:
ubuntu 18.04 / nvidia GTX1070 8GB driver 418.56
Issue description:
When creating two StaticBody2Ds, no matter how well aligned they are, a RigidBody2D passing over them will jump upwards sometimes. I expected the RigidBody2D to just roll over the connection since there is no gap at all, but it jumps instead.
GIF video of the issue
https://media.giphy.com/media/d7SgPewvXmuwsfw8w9/giphy.gif
Steps to reproduce:
Attach the GDScript code below to a Node2D in a new project, and run:
The text was updated successfully, but these errors were encountered: