Use class name for type check since it is available.
parent
9d3b70f76f
commit
f648e162fe
|
@ -1,3 +1,4 @@
|
||||||
|
class_name Weapon
|
||||||
extends Spatial
|
extends Spatial
|
||||||
|
|
||||||
signal damage_dealt
|
signal damage_dealt
|
||||||
|
@ -64,7 +65,7 @@ func shoot(camera):
|
||||||
if hit.has_method("on_hit"):
|
if hit.has_method("on_hit"):
|
||||||
hit.rpc("on_hit", 30, result.position)
|
hit.rpc("on_hit", 30, result.position)
|
||||||
|
|
||||||
if hit is preload("res://Classes/Player/Player.gd"):
|
if hit is Player:
|
||||||
emit_signal("damage_dealt")
|
emit_signal("damage_dealt")
|
||||||
print(player.get_network_master())
|
print(player.get_network_master())
|
||||||
else:
|
else:
|
||||||
|
|
Reference in New Issue