more tweaks
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user