I am currently following a tutorial on YouTube to make a FirstPerson Movement and get this error in Unity: Assets\Scripts\PlayerMovment\PlayerMovment.cs(13,5): error CS0246: The type or namespace name ’Vectore3′ could not be found (are you missing a using directive or an assembly reference?). Can someone help me?
Here’s the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
[Header("Movment")]
public float moveSpeed = 5f;
float horizontalMovement;
float verticalMovement;
Vectore3 moveDirection;
Rigidbody rb;
private void Start(){
rb = GetComponent<Rigidbody>();
rb.freezeRotation = true;
}
private void Update(){
MyInput();
}
void MyInput(){
horizontalMovement = Input.GetAxisRaw("Horizontal");
verticaMovement = Input.GetAxisRaw("Vertical");
moveDirection = transform.forward * verticalMovement + transform.right * horizontalMovement;
}
private void FixedUpdate(){
MovePlayer();
}
void MovePlayer(){
rb.AddForce(moveDirection.normalized * moveSpeed, ForceMode.Acceleration);
}
}
>Solution :
I believe this is down to a typo. Vectore3 should read Vector3.