more tweaks

This commit is contained in:
derek
2024-11-04 11:20:19 -06:00
parent 0493216c25
commit 4242f58a87
62 changed files with 262 additions and 210 deletions

View File

@@ -17,10 +17,14 @@ func _process(delta: float) -> void:
basis = Quaternion.from_euler(current_rotation)
func add_recoil(recoil_amount,snap_change,speed_change) -> void:
#set to provided snap/speed changes
snap_amount = snap_change
speed = speed_change
#vertical recoil and random L+R recoil within given range
var recoil_x = recoil_amount.x
var recoil_y = randf_range(-recoil_amount.y,recoil_amount.y)
var recoil_z = randf_range(-recoil_amount.z,recoil_amount.z)
#add to target rotation
target_rotation += Vector3(recoil_x, recoil_y, recoil_z)