Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | David000 |
I need to check if the object the script is on has collided with a KinematicBody2D.
I can’t use the area_entered signal because I already used that for something else and it just wouldn’t work.
Any suggestions?
use signal area
func _on_Area2D_body_entered(body):
if body is KinematicBody2D:
print(“bla bla”)
pass
Note : i think Area_entered hard except
ramazan | 2021-12-31 12:51
how can I get the name?
David000 | 2021-12-31 16:30
print(bla bla )
print(body.name)
ramazan | 2021-12-31 16:51
func onArea2Dbodyentered(body):
if body.name == "node name’:
print(“bla bla”)
ramazan | 2021-12-31 16:53
thanks!ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
David000 | 2022-01-01 14:34