Chelimbalo/scripts/weapon_system/dropped_weapon.gd
2025-11-28 18:03:30 +05:00

15 lines
337 B
GDScript

extends RigidBody3D
class_name DroppableWeapon
const IMPULSE = 10
@export var slot: StringName
@export var weapon: WeaponSubStateMachine
@export var team: Session.TEAMS
@rpc("any_peer","call_local","reliable")
func drop(direction: Vector3,new_position: Vector3):
apply_impulse(direction * IMPULSE)
global_position = new_position