When I start my game I have this error message:
‘CharacterController’ does not contain a definition for ‘Move’ and no accessible extension method ‘Move’ accepting a first argument of type ‘CharacterController’ could be found (are you missing a using directive or an assembly reference?)
I Don’t know how to fix this, could you help me please?
This is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CharacterController : MonoBehaviour
{
public float speed = 10f;
public float jump = 20f;
private Vector2 DirectionDeplacement = Vector2.zero;
private CharacterController Player;
// Start is called before the first frame update
void Start()
{
Player = GetComponent();
}
// Update is called once per frame
void Update()
{
DirectionDeplacement.x = Input.GetAxisRaw(“Horizontal”);
DirectionDeplacement = transform.TransformDirection(DirectionDeplacement);
Player.Move(DirectionDeplacement * speed * Time.deltaTime);
}
}