How to make enemies drop consumable items? [Megaman FanGame]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Matt101

I’ve been using godot for maybe a month, so now i’m trying to make a Megaman Fan game. And just like in Megaman, i wanna that in my game, when a enemie dies, he’ll drop a little consumable item that spawn at the enemie position and then fell until it hits the floor.

I have used an Area2D node to create the item, and it worked, the problem is that i don’t know how to apply gravity to that Area2D to make the item fall. How do i do that?

Note: Forgive my English, it’s not my mother language

Update: If anyone here still have the same problem that i had. Watch out for the collision mask task bar.

Matt101 | 2021-08-14 01:55

:bust_in_silhouette: Reply From: lewis glasgow

put the area2D in a rigidbody and give it add_central_force(Vector2(-10,0)

Thank you so much for answer, you help a lot with that

Matt101 | 2021-08-13 17:13