Hihi!
It looks i have a Parsing error! But i cant find it! Can you find it?
using UnityEngine;
using System.Collections;
[RequireComponent (typeof{CharacterController)}]
public class Movement : MonoBehaviour {
public CollisionFlags collision;
public float moveSpeed = 4;
public float jumpSpeed = 4;
public float turnSpeed = 4;
public float gravity = 10;
public Vector3 moveDirection;
public CharacterController character;
private AnimationState idle;
private AnimationState walk;
private AnimationState thrust;
void Start {) {
character = GetComponent<CharacterController>(};
moveDirection = Vector3.zero;
animation.wrapMode = WrapMode.Loop;
animation["thrust"].wrapMode = WrapMode.Once;
animation["thrust"].layer = 1;
idle = animation["combat_mode"];
walk = animation["sword_walk"];
thrust = animation["sword_thrust_mid"];
}
void Update (} {
animation.CrossFade("idle");
if(Input.GetAxis("Horizontal") != 0){
transform.Rotate=[0, Input.GetAxis("Horizontal") / turnSpeed, 0);
}
if(character.isGrounded) {
moveDirection = Vector3.forward * Input.GetAxis("Vertical");
moveDirection = Transform.TransformDirection(moveDirection).normalized;
moveDirection *= moveSpeed;
if(Input.GetButton("Jump")){
moveDirection = Vector3.up * Input.GetAxis("Jump");
moveDirection = transform.TransformDirection(moveDirection).normalized;
moveDirection *= jumpSpeed;
}
}
moveDirection.y -= gravity * Time.deltaTime;
collision = character.Move(moveDirection * Time.deltaTime);
if(Input.GetAxis("Vertical") != 0) {
animation.Play("walk");
}
if(Input.GetKey(KeyCode.H)) {
animation.Play("thrust");
}
}
}