Use class name for type check since it is available.

pull/42/head
tokc 2021-03-31 11:51:25 +02:00
parent 9d3b70f76f
commit f648e162fe
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
class_name Weapon
extends Spatial
signal damage_dealt
@ -64,7 +65,7 @@ func shoot(camera):
if hit.has_method("on_hit"):
hit.rpc("on_hit", 30, result.position)
if hit is preload("res://Classes/Player/Player.gd"):
if hit is Player:
emit_signal("damage_dealt")
print(player.get_network_master())
else: