Started work and initial commit

This commit is contained in:
derek
2024-10-02 14:54:32 -05:00
parent 5d2cd1a13e
commit 3121e9d4d2
22 changed files with 763 additions and 599 deletions

22
scripts/recoil.gd Normal file
View File

@@ -0,0 +1,22 @@
extends Node3D
var recoil_amount : Vector3 = Vector3(.1,0,0)
var snap_amount : float = 8
var speed : float = 4
var current_rotation : Vector3
var target_rotation : Vector3
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
target_rotation = lerp(target_rotation, Vector3.ZERO, speed * delta)
current_rotation = lerp(current_rotation, target_rotation, snap_amount * delta)
basis = Quaternion.from_euler(current_rotation)
func add_recoil() -> void:
print("ADD RECOIL")
target_rotation += Vector3(.1,0,0)