multiplayer
This commit is contained in:
parent
aa35ee5975
commit
0dc6247f91
22 changed files with 298 additions and 14 deletions
22
scripts/smoke_grenade.gd
Normal file
22
scripts/smoke_grenade.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
extends RigidBody3D
|
||||
|
||||
|
||||
@export var radius: float
|
||||
@export var fog: FogVolume
|
||||
|
||||
var bounce_count: int = 0
|
||||
|
||||
|
||||
func _on_body_entered(_body: Node) -> void:
|
||||
if bounce_count > 2:
|
||||
return
|
||||
bounce_count += 1
|
||||
if bounce_count == 2:
|
||||
smoke()
|
||||
|
||||
func smoke():
|
||||
var tween = create_tween().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_EXPO)
|
||||
tween.tween_property(fog,"size",Vector3(radius,radius,radius),1.0)
|
||||
tween.tween_interval(10)
|
||||
tween.tween_property(fog.material,"density",0,1.0)
|
||||
tween.tween_callback(queue_free)
|
||||
Loading…
Add table
Add a link
Reference in a new issue