Hello, I'm having some trouble with the Rigidbody2d class and its getcollidingbodies function.
I'm making an endless runner close to Google Chrome's dino just to test out the engine but I'm having some trouble detecting the collisions between the player and the obstacles.
This is my code so far:
speed.y = JUMP_FORCE * (-1)
speed.x = 0
speed.y += GRAVITY * delta
velocity = Vector2(speed.x*delta,speed.y*delta)
if inst != null :
if spawnTimer >= 3:
inst = load("res://pawns/obstacles/funky_cactus.xml").instance()
spawnTimer = 0
spawnTimer += delta
Basically every time the player spawns it hits the ground and it stays there and
get_colliding_bodies().size()is equals to 1 but every time an obstacle comes to the player the size of the array of colliding bodies is always 1.