I Maked a character with animation (Walk Jump), But I Don’t Know how can run this animations with Scripts. Please tell me how can I do it? I recently worked with this engine, and I’m going to make a game please help me to do this.
When you feel you know scripting and unerstand the animation concept.
Import your character to unity, split the animations, create a script to do the animation.play();, attach the script to your char, and there you go.
It’s not so simple, “like please unity play the animation”… but as soon you learn scripting and the concept will be really easy to do so.
Thanks, I See This Document but I think it is too much to begin with.
I know a little scripting but if you can offer a simpler way to understand the animation is much better.This file includes all forms of animation, and I still use the keyboard to use the Animation do not know.
OK then, first search at youtube how to import your char and split the animations by the unity inspector. After that, put your char at scene and attach this script to the char.
using UnityEngine;
using System.Collections;
/// <Sumario>
/// Stêffano de Moura
/// 28/08/2012
/// </Sumario>
public class Animator : MonoBehaviour
{
void Update()
{
//If the button is pressed
if (Input.GetButton("Fire1"))
{
//Fade in the animation
animation.CrossFade("YOUR_ANIMATION_NAME");
}
else
{
///if not fade in other
animation.CrossFade("YOUR_ANOTHER_ANIMATION_NAME");
}
}
}