Adds missing data
This commit is contained in:
parent
e6391d9fdd
commit
53cdcc3433
620 changed files with 47293 additions and 151 deletions
20
prefabs/death_handler.gd
Normal file
20
prefabs/death_handler.gd
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
extends Node
|
||||
class_name DeathHandler
|
||||
|
||||
@export var camera: Node3D;
|
||||
|
||||
var enabled: bool = false
|
||||
var targetDirection: Vector3;
|
||||
|
||||
func died(from: Node3D):
|
||||
print(from, ' ', from.global_position)
|
||||
enabled = true
|
||||
|
||||
var direction = (from.global_position - camera.global_position).normalized()
|
||||
var previousForward = -camera.global_basis.z;
|
||||
|
||||
create_tween().tween_method(self.rotateToTarget.bind(direction, previousForward), 0.0, 1.0, 1.0).set_trans(Tween.TRANS_EXPO)
|
||||
|
||||
|
||||
func rotateToTarget(weight:float, targetDirection: Vector3, previousForward: Vector3) -> void:
|
||||
camera.look_at(lerp(camera.global_position + previousForward, camera.global_position + targetDirection, weight))
|
||||
Loading…
Add table
Add a link
Reference in a new issue