Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | iconicity | |
Old Version | Published before Godot 3 was released. |
I’m very very new to Godot so apologies in advance.
I’m making a project and I want a very simple inventory. I have made gems (and various other objects throughout the levels) for the player to collect, and my goal is to have a larger, non-interactable object in the corner with text for how many of something the player has.
At this point I can’t even figure out how to get the gems to disappear when the player collides with them. They collide normally, but I can’t figure out how to make them disappear.
I think the issue is with trying to control collisions through the player which is a kinematic body, not a rigid body…? I’ve been trying queue free() in different scenarios, through the player which won’t have it, and I experimented under the gem code for queue free(self) but I don’t even know if that’s a legitimate command.
Thanks so much. I’ve probably spent 4 hours today in tutorials but they’re all so different and nothing is working for me.
I’m doing this exact thing in my current tutorial: Godot 101. I haven’t shown the gem collecting yet, but that’s the next video, due out in a couple of days.
I’m just using Area2D for my player, but it’s the same process to do it with Kb2D if the gems are Area2D (since you don’t need to collide/bounce off the gems, they don’t need to be a PhysicsBody). With Area2D on the gems, it’s just connecting the on_body_enter()
signal to a callback that does queue_free() and the gem disappears.
How are your nodes set up?
kidscancode | 2017-02-26 00:44