Basically I was making a 2D animation using limb parts connected to the body (it is not pixel based) for Metroidvania platformer.
I want my character to move arms with guns separately from the walking legs (just like FPS games). However, when the walking animation is ON, the arm movement that has been coded by the script does not override on the animation’s movement.
private void FixedUpdate()
{
Vector3 difference = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
difference.Normalize();
float rotationZ = Mathf.Atan2(difference.y, difference.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(0f, 0f, rotationZ);
}
I have coded on the arm component so that it always rotate towards the mouse pointer, but the movement does not override on the animation.
How do I make this work?