tweaks to oil drum
This commit is contained in:
@@ -16,7 +16,7 @@ var bullet_active = true
|
||||
@onready var enemy_particles = $GPUParticlesEnemy
|
||||
@onready var hit_indicator = $Audio/HitIndicator
|
||||
@onready var ray: RayCast3D = $RayCast3D
|
||||
|
||||
@onready var water_leak : Resource = preload("res://assets/water_leak.tscn")
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
@@ -55,6 +55,17 @@ func _physics_process(delta):
|
||||
instance_bullethole.look_at(ray.get_collision_point() + ray.get_collision_normal())
|
||||
instance_bullethole.rotation.z = deg_to_rad(randf_range(0,360))
|
||||
|
||||
# Leaking effect
|
||||
if body.is_in_group("leak"):
|
||||
var leakspawn = water_leak.instantiate()
|
||||
body.add_child(leakspawn)
|
||||
leakspawn.global_transform.origin = ray.get_collision_point()
|
||||
if (abs(ray.get_collision_normal().y) > 0.99):
|
||||
leakspawn.look_at(ray.get_collision_point() + ray.get_collision_normal(), Vector3(0,0,1))
|
||||
else:
|
||||
leakspawn.look_at(ray.get_collision_point() + ray.get_collision_normal())
|
||||
leakspawn.rotation.z = deg_to_rad(randf_range(0,360))
|
||||
|
||||
if body.is_in_group("switch"):
|
||||
body.hit()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user