#my Area2D is strange

1 messages · Page 1 of 1 (latest)

gritty kettle
#

Hey I have an Area2D Node that has CollisionPolygon2D. If I let spawn an StaticBody2D (the white square) on my grass, Area2D don't emit "body_entered"-signal.

If my character2D moves (moves_and_slide()) in the grass, it also don't emit the signal of "body_entered".

BUT if I move the points of my collisionGrass, so at start of the game it touches automaticly my character2D THEN IT EMITS the Signal!

Body has neither id as property or in meta list. Name: CarCharacter
   At: res://grass_area.gd:31:_on_body_grass_area_entered()
#

If I run my game, then I run this scene.

#

My car uses CollisionShape2D

sonic vessel
#

can you zip the project and upload it here?

sonic vessel
#

I'll have a look and see if I can find the reason

gritty kettle
#

not the CarCharacter itself

sonic vessel
#

If you set the car's collision layer to 5 then it seems to trigger on body entered when driving onto the grass.. Going to test some stuff to see why this doesn't work for the wheels

#

If you change the type of the wheels from StaticBody2D to Area2D, and connect the area_entered signal for the grass, then it seems to work

#

Not sure what the underlying problem is, but I guess it could be either that the engine doesn't expect a "static" body to move, or perhaps that you're not supposed to make bodies children of other bodies

#

Docs says that StaticBody2D can be moved by code, so I suppose that wasn't the cause