- Home /
free motion in mecanim
how would I go about making a mecanim character controller based on movement like this???
video: https://www.youtube.com/watch?v=aH6AYuqQo90
I mean no tutorials help me on top of that people just use scripts that come with unity along with the animations and characters! non show their own animated characters movement and I'm at a huge rode block this is really frustrating me some one just explain to me how in freaking world do I set up the animations and scripts it base on free motion meaning the player character always walks forward no matter what direction they are moving on screen. I seriously can't find any help and I've been trying to this for about 4 months now some one please just tell me I swear no answers to other questions help I already know how to create my animations and set them up in unity's mecanim system just tell me how to do this here's another great example of what I'm trying to do >:(
video : https://www.youtube.com/watch?v=BtgIA5_6uV8
so please this is a desperate cry for help please just help me it's been 4 months and still can't find a solution
It's unclear what you're stuck on... " meaning the player character always walks forward no matter what direction they are moving on screen" - this sounds like a camera problem, not an animation problem. But if you've been working on it for 4 months, at least show us what you've got at the moment.
I'm stuck on making a character move as in run in any direction without strafing as in the first and second link please just try explain the code I've set up my 3 animations in melanin I just need D's to know how i can script it to where 1 there is no strafing and 2 they move almost exactly like in the example
Please don't post comments as answers. You've not shown us your animation controller, so I don't see how you're expecting us to point out where you've gone wrong: how is your blend tree configured? Are you using root motion?
I don't think any of the $$anonymous$$ecanim examples I've seen use strafing, so I can't work out why what you're asking for is different from the default behaviour anyway. The links you've pasted are just videos, so aren't that helpful. What specifically is it that you want to achieve that isn't implemented in, say, https://www.assetstore.unity3d.com/en/#!/content/5328 ?
ok so here's the codeing
UnityEngine; using System.Collections;
public class SoraScript : $$anonymous$$onoBehaviour { Animator anim; int jumpHash = Animator.StringToHash("Jump"); int runStateHash = Animator.StringToHash("Base Layer.Run");
void Start ()
{
anim = GetComponent<Animator>();
}
void Update ()
{
float move = Input.GetAxis ("Vertical");
anim.SetFloat("Speed", move);
AnimatorStateInfo stateInfo = anim.GetCurrentAnimatorStateInfo(0);
if(Input.Get$$anonymous$$eyDown($$anonymous$$eyCode.Space) && stateInfo.nameHash == runStateHash)
{
anim.SetTrigger (jumpHash);
}
}
}
Yes... and where do you supply the parameter to the Animator controller to blend your turn left/right animations...?