I'm trying to code a game in Godot 3 where my character can collect certain objects. The moment the character collects them - i.e collides with them, the object disappears and gets added to an array.
While doing this, I have successfully managed to make the object disappear, but somehow the area around which the object existed is still not walkable - in the sense, the collision object of the kinematic body object is somehow still functioning and I don't want it to still be there.
This GIF explains the problem:
Code for collision -
for body in $hitbox.get_overlapping_bodies():
if(body.get("type")!= "prota"):
if body.get("type")=="ingredient":
inventory.add_to_inventory(body, body.get("type"), "collect")
Inventory.add_to_inventory function -
func add_to_inventory(the_item, item_type, cause):
if item_type=="ingredient":
if cause=="collect":
inventory_ingredients.append(the_item)
the_item.hide()
The above snipped appends the item into my array as required. It also hides the object but the collision object is still there.
Structure of the collision object (Pineapple):
Placement of objects on my LevelL
The Sprite's texture is loaded using code and is not manually added.
get_node("Pineapple").get_node("Display").set_texture(pineapple)
Any help regarding this will be appreciated. I am willing to provide more details if needed. I have very little background in coding and I might have made rookie mistakes too!

