extends Node @export var RocketProjectile: PackedScene func activate(world, activator): var rocket = RocketProjectile.instantiate() var target = activator.get_target_pos() rocket.position = activator.position rocket.look_at(target) if activator.get_collision_layer_bit(1): # player object rocket.set_collision_layer_bit(1, false) rocket.set_collision_layer_bit(2, true) elif activator.get_collision_layer_bit(2): # enemy object rocket.set_collision_layer_bit(1, true) rocket.set_collision_layer_bit(2, false) else: assert(false, "who are you, activator?") func discard(world, activator): pass