Hey, so I’m making a thirdperson game in which my character is able to climb an height obsticle just by moving into it. This should kinda work similary liking scaling obstacles in mirrors edge or a parkour game. I already have downloaded some animations from MIXAMO but i dont know how to go about doing it. Anyhere here’s my animation script:
![using UnityEngine;
using System.Collections;
public class ExoCtrlScript : MonoBehaviour {
private Animator ExoThysius;
// Use this for initialization
void Start() {
ExoThysius = GetComponent<Animator>();
}
// Update is called once per frame
void Update() {
ExoThysius.SetFloat("Vspeed", Input.GetAxis("Vertical"));
ExoThysius.SetFloat("Hspeed", Input.GetAxis("Horizontal"));
// TURNING
if (Input.GetAxis("Horizontal")!=0)
{
ExoThysius.SetBool("Turning", true);
if (Input.GetAxis("Horizontal") > 0)
{
transform.Rotate(Vector3.up * Time.deltaTime * 100.0f);
}
//turn left
if (Input.GetAxis("Horizontal") < 0)
{
transform.Rotate(Vector3.down * Time.deltaTime * 100.0f);
} //turn right
}
else
{
ExoThysius.SetBool("Turning", false);
}
if (Input.GetAxis("Vertical") != 0 && (Input.GetAxis("Horizontal")) > 0) // running and turning left
{
transform.Rotate(Vector3.up * Time.deltaTime * 100.0f);
ExoThysius.SetBool("Turning", true);
}
if (Input.GetAxis("Vertical") != 0 && (Input.GetAxis("Horizontal")) < 0) // running and turning right
{
transform.Rotate(Vector3.down * Time.deltaTime * 100.0f);
ExoThysius.SetBool("Turning", true);
}
if (Input.GetButtonDown("Jump"))
{
ExoThysius.SetBool("Jumping", true);
Invoke("StopJumping", 0.1f);
}
}
void StopJumping()
{
ExoThysius.SetBool("Jumping", false);
}
}][1]