Sprite Ghost Through Sprite of Sprite Kind

currently I have a sprite that when overlapping with a sprite of kind enemy takes damage and is then set to ghost through sprites for a couple of seconds.

This works fine, but while the sprite is ghosted it can’t overlap with any other sprites. I have weapons and Items that the player can pick up when the sprite’s overlap and would like the sprite to be able to pick up the items while ghosted from the enemy sprites.

I can’t find anything for this anywhere I have looked so I’m starting to think that ghosting the sprite for only specific sprite kinds is not something I can do, and I am going to have to change a lot of code so that on overlap with Enemy sprites it has to check if the player is in its immunity frames and if not they take damage

I would rather find a solution that still uses ghosting through the enemy sprites though.

(attached is said game, and you can see that after fighting the first boss and getting eaten that it takes several seconds for the player to pick up the sword, this is because the player is ghosted for 3 seconds anytime they enter a room)

1 Like

Yeah, ghosting through specific sprites isn’t a thing, but I do have an easy solution. Just add this to the end of the (on sprite overlaps) code block:

If (variable) = 0:
Set (variable) to 1
Wait (3000) (3 seconds)
Set (variable) to 0

This should make it so that, if your sprite touches something, it won’t be able to “touch” said thing until 3 seconds passes. You might also want to add
(If variable = 0 OR variable = 2:
So that you can activate the wait whenever you want to by setting (variable) to 2 (like you mentioned when you enter a room)
Hope this helps!!!