diff options
| -rw-r--r-- | client/map/items/item.gd | 17 | 
1 files changed, 12 insertions, 5 deletions
| diff --git a/client/map/items/item.gd b/client/map/items/item.gd index 710d0081..d256343c 100644 --- a/client/map/items/item.gd +++ b/client/map/items/item.gd @@ -27,6 +27,7 @@ var put_sound: PlayRandom = preload("res://audio/play_random.tscn").instantiate(  var sound_id  var destroy_timeout = null +var creation_timer = 0  func _init(owned_by_: Node3D):  	progress_instance.position.y = 1 @@ -42,6 +43,8 @@ func _init(owned_by_: Node3D):  	base.name = "Base"  	add_child(base)  	owned_by = owned_by_ +	if not owned_by.get_parent() is Item and not owned_by is Item: +		scale = Vector3.ONE * 0.001 # setting to zero breaks assertions somewhere in the engine  func _process(delta):  	if not is_instance_valid(owned_by): return @@ -52,13 +55,17 @@ func _process(delta):  	position = G.interpolate(position, owned_by.global_position, delta * ispeed)  	if p: rotation.y = G.interpolate_angle(rotation.y, owned_by.global_rotation.y, delta * ispeed)  	else: rotation.y = G.interpolate_angle_closest_quarter(rotation.y, owned_by.global_rotation.y, delta * ispeed) +	if creation_timer != null: +		scale = Vector3.ONE * creation_timer +		creation_timer += delta * 10.0 +		if creation_timer > 1:  +			scale = Vector3.ONE +			creation_timer = null  	if destroy_timeout != null: -		if is_instance_valid(progress_instance): -			progress_instance.queue_free() -		destroy_timeout -= delta * 5. +		destroy_timeout -= delta * 5.0  		scale = Vector3.ONE * destroy_timeout -		if destroy_timeout <= 0: -			queue_free() +		if is_instance_valid(progress_instance): progress_instance.queue_free() +		if destroy_timeout <= 0: queue_free()  func progress(position_: float, speed: float, warn: bool):  	progress_instance.visible = true | 
