#UI and Sound Effects not working on player collision.

8 messages · Page 1 of 1 (latest)

tropic parrot
#

I'm trying to have a UI above the player update when the player moves over an object that can be "picked up". But I’m having trouble with it.

When the player collides with a power-up or gem, a sound effect should play. The sound is not playing, nor is the UI updating to reflect the changes.

Can anyone help me figure out what I’m doing wrong or link me to an answer for reference? I’ve looked around but couldn’t find anything.

pearl cypress
#

I see that you're connecting "area_entered" to "_on_area_entered" in the _ready function. [Sorry, I missed that in my prior response.]

  1. Ensure the collision layer(s) of the pickups appears in the collision mask of the ship.
  2. Ensure that your spawner is calling pickup.add_to_group() after the pickup is spawned.
  3. Ensure the group name assigned to the pickup exactly matches the group name you're looking for.
#

If none of that helps, I'd try connecting your signal via the editor rather than the _ready function. I'm not sure why that would be a problem, but it might be worth a shot.

tropic parrot
tropic parrot
#

The ship's mask was the issue. For some reason it reset to default. Maybe when I instantiate it via code?

pearl cypress
#

Seems likely. Double check that your ship's packed scene has the right mask saved. But possible that instantiation is messing with it.

tropic parrot
#

Packed scene?

hexed bone