Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | gauravdubey99 |
I have a code that moves and slides the object using JoyStick and I am able t successfully get the result of movement. But when I start the animation using AnimationPlayer the movement suddenly stops. What might I be doing wrong?
Here is the code I am using
func set_direction_and_smovement_trength(direction, strength):
var directionForCharacterAxis_Y = -direction - 90
rotation_degrees.y = directionForCharacterAxis_Y
strengthOfMovement = strength
if(strength > 0):
$BarbarianAnimation.play('WALK')
func _physics_process(delta: float) -> void:
velocity = delta * movementSpeed * strengthOfMovement * transform.basis.z
move_and_slide(velocity, Vector3.UP)
Also my movement begins when my Animation has finished