summaryrefslogtreecommitdiff
path: root/scripts/ballistics/NetworkedProjectile.gd
blob: d9304cf82f67b824fb318167be1b84b084da6c41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
extends RigidBody

var shooter = "WORLD"
var shooter_id = 1


# Called when the node enters the scene tree for the first time.
func _ready():
	pass # Replace with function body.

func mp_init(init_info):
	for variable in init_info.keys():
		set(variable, init_info[variable])

remote func update_phys_transform(t, lv, av):
	transform = t
	linear_velocity = lv
	angular_velocity = av
	
func _integrate_forces(state):
	if is_network_master():
		rpc("update_phys_transform", transform, linear_velocity, angular_velocity)

remotesync func net_remove():
	queue_free()

func net_master_remove():
	if is_network_master():
		rpc("net_remove")