#PLayerMovement Animation issues

1 messages · Page 1 of 1 (latest)

dapper coyote
#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SigmaWalkingSound : MonoBehaviour
{

public AudioSource InsaneSigmaWalkingSound;
public Animator ANI;
public  bool walking;

// Start is called before the first frame update
void Start()
{
  InsaneSigmaWalkingSound.enabled = false;
}

// Update is called once per frame
void Update()
{
    if (Input.GetKey("w") || (Input.GetKey("s")) || (Input.GetKey("a") || (Input.GetKey("d"))))
    {
        InsaneSigmaWalkingSound.enabled = true;


    }
    else
    {
        InsaneSigmaWalkingSound.enabled = false;
    }


        if(Input.GetKeyDown(KeyCode.W)){
        ANI.SetTrigger("walk");
        ANI.ResetTrigger("idle");
        walking = true;
        //steps1.SetActive(true);
    }
    if(Input.GetKeyUp(KeyCode.W)){
        ANI.ResetTrigger("walk");
        ANI.SetTrigger("idle");
        walking = false;
        //steps1.SetActive(false);
    }
    if(Input.GetKeyDown(KeyCode.A)){
        ANI.SetTrigger("left");
        ANI.ResetTrigger("idle");
        //steps1.SetActive(true);
    }
    if(Input.GetKeyUp(KeyCode.D)){
        ANI.ResetTrigger("right");
        ANI.SetTrigger("idle");
        //steps1.SetActive(false);
}

}

}

vivid prawn
#

Fix it

#

Hope that helps

dapper coyote
#

cheers man

#

but do you know how actually fix the issue

vivid prawn
#

In case it wasn't obvious, I was being sarcastic because you have given absolutely zero information. I don't know how you expect anyone to help you if the best you're gonna give is "please help" followed by dumping your code in

wintry stream
#

in other words,

#

[]unclearquestion

fluid sphinxBOT
#

Before others can help, a clear question must be formulated

When you ask a difficult question it is your responsibility to ensure that anyone reading it will have all of the information they need to understand and diagnose the problem. Sometimes questions aren’t as clear to others as they could be or they may be missing critical information needed to provide a correct answer.
Source: https://idownvotedbecau.se/unclearquestion

Please elaborate on your question by including all the relevant information such as:

  • The programming language within which you're working (if it is anything other than C#)
  • Exactly what it is you're trying to accomplish
  • Things you have considered/attempted already
  • Anything else that could aid answerers in resolving the issue
dapper coyote
#

i can walk forward and backwards but not left and right

#

the animation doesnt play

wintry stream
#

Have you considered using a blend tree instead of individual states?

#

Also, resetting triggers like that is the most pointless thing I've seen in a while. They will literally reset on their own. That's their whole point.

dapper coyote
#

frick i made it so it reset the right and back trigger