using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour {
public float speed = 10f;
public float jumpSpeed = 6f;
Vector3 direction = Vector3.zero;
float verticalVelocity = 0f;
CharacterController cc;
// Use this for initialization
void Start () {
cc = GetComponent<CharacterController>();
}
// Update is called once per frame
void Update () {
direction = transform.rotation * new Vector3( Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical") );
if(direction.magnitude > 1f) {
direction = direction.normalized;
}
if( Input.GetButton ("Jump")) {
Vector3 cc.transform.position.transform.up = jumpSpeed.Time.deltaTime;
}
}
void FixedUpdate () {
Vector3 dist = direction * speed * Time.deltaTime;
verticalVelocity = Physics.gravity.y * Time.deltaTime;
verticalVelocity += Physics.gravity.y * Time.deltaTime;
dist.y = verticalVelocity * Time.deltaTime;
cc.Move( dist );
}
}
I have been following some programming and Unity tutorials and have got most of the code from them but the Unity editor keeps complaining with error code CS1525: unexpected symbol ‘.’ expecting “)”, ’ , ; , [ or =
I have been trying to fix it for some time now but when I fix it more errors keep coming up with other errors to replace it.
I would very much appreciate it if you could help me.