Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Memorix101 |
I’m looking for an area_entered equivalent in C#
like
func _on_Area2D_body_enter(other):
print(other.get_name())
in C#
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Memorix101 |
I’m looking for an area_entered equivalent in C#
like
func _on_Area2D_body_enter(other):
print(other.get_name())
in C#
Reply From: | kidscancode |
area_entered
is a signal. Signals can be connected to any function. If you use the editor to automatically create a receiving function, it will follow the scheme _on_nodeName_signal_name()
. Otherwise you can create the function like any other C# function and connect the signal to it either via the editor or in code.
public void OnArea2DAreaEntered(Area2D area)
{
// your code here
}
See the Signals tutorial for details.
Great! Thanks!
Memorix101 | 2019-09-25 01:26