I’m New to unity and i have looked at the code multiple times and can’t find the error
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ThirdPersonPlayer : MonoBehaviour
{
// steps1.setActive(true)
public Animator playerAnim;
public Rigidbody playerRigid;
public float w_speed, wb_speed, olw_speed, rn_speed, ro_speed;
public bool walking;
public Transform playerTrans;
void Fixed Update(){
if(Input.GetKey(KeyCode.W)){
playerRigid.velocity = transform.forward * w_speed * Time.deltaTime;
}
if(Input.GetKey(KeyCode.S)){
playerRigid.velocity = -transform.forward * wb_speed * Time.deltaTime;
}
}
void Update(){
// Walk, Backwalk, and Idle Code
if(Input.GetKeyDown(KeyCode.W)){
playerAnim.SetTrigger("Jog");
playerAnim.ResetTrigger("Idle");
walking = true;
}
if(Input.GetKeyUp(KeyCode.W)){
playerAnim.ResetTrigger("Jog");
playerAnim.SetTrigger("Idle");
walking = false;
}
if(Input.GetKeyDown(KeyCode.S)){
playerAnim.SetTrigger("B Jog");
playerAnim.ResetTrigger("Idle");
walking = true;
}
if(Input.GetKeyUp(KeyCode.S)){
playerAnim.ResetTrigger("B Jog");
playerAnim.SetTrigger("Idle");
walking = false;
}
// Rotation Code
if(Input.GetKey(KeyCode.A)){
playerTrans.Rotate(0, -ro_speed * Time.deltaTime, 0);
}
if(Input.GetKey(KeyCode.D)){
playerTrans.Rotate(0, ro_speed * Time.deltaTime, 0);
}
// Sprint Code
if(walking == true){
if(Input.GetKeyDown(KeyCode.LeftShift)){
w_speed = w_speed + rn_speed;
playerAnim.SetTrigger("Sprint");
playerAnim.ResetTrigger("Jog");
if(Input.GetKeyUp(KeyCode.LeftShift)){
w_speed = olw_speed;
playerAnim.ResetTrigger("Sprint");
playerAnim.SetTrigger("Jog");
}
}
}
}
}