Animations Bad Scripting | Controller Script Buggy | Collider Problem | Beginner Here!
I'm make a game with a first person player with a body (for multiplayer)... There are several animations assigned to the character but it does not what I want! If I press nothing: idle Works :) If I press "Z" (forward on azerty): walk Does not work :( If i press "Z" + LeftShift: run Does not work :( If i press space: jump Does not work!!!! :(
// Use this for initialization
void Start ()
{
anim.Play("idle");
}
// Update is called once per frame
void Update () {
if ((Input.GetKey(KeyCode.Z)) && shiftcheck == false)
{
anim.Play("walk");
}
else
{
if (shiftcheck == false)
{
anim.Play("idle");
}
}
if ((Input.GetKey(KeyCode.Z)) && (Input.GetKey(KeyCode.LeftShift)))
{
anim.Play("run");
shiftcheck = true;
}
else
{
shiftcheck = false;
anim.Play("idle");
}
if (Input.GetKeyDown(KeyCode.Space))
{
anim.Play("jump");
}
else
{
anim.Play("idle");
}
}
}
Also: The default controller scripts are buggy. But i don't know how to make one my self! Also: I have a flat box collider in my map but when a player walks on it he moves automaticly forward and can't control his movement any longer! Why is that?
Your answer
Follow this Question
Related Questions
Interchangeable animations in a script? 0 Answers
How do I find the direction I'm going for my blend tree? 0 Answers
How do I make a x move and y move parameter 0 Answers
change game character/controller when inside box - RFPSP 1 Answer
FPS Controller 1 Answer