increase wait time

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

hello, I need some help in my project
I have in main scene one timer, one label with countdown.
I have a scene “player”
I have an hourglass (area2d)
I don"t get to use signal
I need to increase for example, 30 seconds in my countdown (main scene)
when player on body_entered in hourglass.

how can I do that?

:bust_in_silhouette: Reply From: RenenerG

Hello CB,

I guess your player node is a KinematicBody2D. That means your Area2D is capable of detecting collisions between them.

There are a few things to check, in order to get that work:

  • Did you connect the signal body_entered of your Area2D to a node, which has a script attached to it?
  • Does the script have a method something called like _on_Area2D_body entered ?
  • Does your Area2D and KinematicBody2D have a CollisionShape2D ?
  • Does the property collision_mask of your Area2D matches with the property collision_layer of your KinematicBody2D?

I suggest you to read more about Signals :-).