fixed hud wobble and removed deprecated scripts
This commit is contained in:
@@ -624,12 +624,18 @@ func grab_moveable(body):
|
||||
held_item.set_collision_layer_value(1,false)
|
||||
|
||||
func hud_wobble(delta):
|
||||
const HUD_WOBBLE_MAX : float = 10
|
||||
const MOUSE_AMT = 0
|
||||
const VELOCITY_AMT = 10
|
||||
var dir = Vector2(-velocity.x * VELOCITY_AMT - mouse_input.x * MOUSE_AMT,velocity.y * VELOCITY_AMT - mouse_input.y * MOUSE_AMT)
|
||||
var dir_clamped = clamp(dir,Vector2(-HUD_WOBBLE_MAX,-HUD_WOBBLE_MAX),Vector2(HUD_WOBBLE_MAX,HUD_WOBBLE_MAX))
|
||||
hud.position = lerp(hud.position, dir_clamped, delta * 5)
|
||||
const HUD_WOBBLE_MAX : float = 20
|
||||
const MOUSE_AMT = 10
|
||||
const VELOCITY_AMT = 100
|
||||
const HUD_SPEED = 10
|
||||
var dir_mouse = Vector2(-mouse_input.x * MOUSE_AMT,-mouse_input.y * MOUSE_AMT)
|
||||
var velocity_dir_transformed = velocity.normalized() * global_basis
|
||||
var velocity_lengh_clamped = clamp(velocity.length(),-VELOCITY_AMT,VELOCITY_AMT)
|
||||
var dir_velocity = Vector2(-velocity_dir_transformed.x * velocity_lengh_clamped,velocity_dir_transformed.y * velocity_lengh_clamped)
|
||||
var dir_clamped = clamp(dir_mouse + dir_velocity,Vector2(-HUD_WOBBLE_MAX,-HUD_WOBBLE_MAX),Vector2(HUD_WOBBLE_MAX,HUD_WOBBLE_MAX))
|
||||
var offset = lerp(hud.position, dir_clamped, delta * HUD_SPEED)
|
||||
hud.position = offset
|
||||
hud.crosshair.position = -offset
|
||||
|
||||
func hold_item(_delta):
|
||||
# Move Held Items
|
||||
|
||||
Reference in New Issue
Block a user