dumb question but i couldnt find a way to solve this
im trying to make a weapon switching system but i want to use as little animations as possible so my plan is to simply lower the gun when unequipping it and raise it when equipping
however im having a problem where i cant do it smootly, for some reason lerp isnt working
extends Node3D
@export var bullets: int = 20
@export var weapon = curWeapon.shotgun #equipped weapon
@onready var hand = $hand
enum curWeapon
{
shotgun,
pistol,
none
}
func _input(event):
if Input.is_action_just_pressed("weapon1"):
weapon = curWeapon.shotgun
if Input.is_action_just_pressed("weapon2"):
weapon = curWeapon.pistol
if Input.is_action_just_pressed("weapon3"):
if weapon != curWeapon.none:
weapon = curWeapon.none
#rotate hand z to -45 here
if you want to use lerp you have to use it in a looping function such as process() since lerp only returns one value. I would use tweens though since they make your life a whole lot easier (basically animations by code).