- Home /
Walk to , jog , then run
Hey guys , i'm Carlos , i'm 12.I'm newbie at Unity i understand some codes , but i'm not a pro, and javascript is something new to me, but i already used gml (from game maker).So.. i have a question.. i have 3 animations that i made on 3ds max : walk , jog and run.I'm trying to make my character walk , jog , then, run.I tried this:
function Start ()
{
animation.wrapMode = WrapMode.Loop;
animation["Idle"].layer= 1;
animation["walk"].layer= 2;
animation["jog"].layer= 3;
animation["run"].layer= 4;
animation["jump"].layer= 5;
}
function Update () {
if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.2)
animation.CrossFade("walk");
else if (Mathf.Abs(Input.GetAxis("Vertical")) > 3)
animation.CrossFade("jog");
else
animation.CrossFade("idle");
but no sucess.. and sorry for my bad english D: Can someone tell me what's wrong with my code? Thanks in advance :D
}
Answer by syclamoth · Dec 20, 2011 at 07:12 AM
This is an incredibly complex problem to get right properly- however, there is a wonderful package called the Unity Locomotion System which solves all of these issues in a way that is far better than anything you or I could do. Best of all, it's free for anyone to use, provided as a free addon to the Unity Engine.
Thanks, i already tried to use this , but i'm doing a Sonic game, so i have to use a different locomotion system. Thanks anyway =D
So? Why does that mean you have to use a different locomotion system?
Platform Input Controller is the better controller to a sonic game , it have everything , i just have to make the animations transition system
You're not paying attention- the Locomotion System isn't an input system or a control scheme. Nothing in that limits how you move your character- it is only a leg animation transition system. It's exactly what you need here- just try it!
Answer by SilvicTHDX · Dec 21, 2011 at 06:42 PM
Oh! Whoops , sorry! Thank you man =D But hey , i'm curious now. Why i would get sued by sega? O:
Because you're making a 'sonic game'. Plagarism, see? It was a joke.
Your answer
Follow this Question
Related Questions
Speed of animation transitoins 2 Answers
How to make a "Run Stop" animation? 1 Answer
walk to run animation 2 Answers
walk crossfade run animation based on joystick position need help please 0 Answers
idle > walk > run animation 1 Answer