I doesn't found the problem in my script.

Hello, i’ve problem with this code and i Don’t know why. I try’d everything but I really Don’t understant what is my mistake.

public float Jump = 20f;

That is the rest of the script the problem is maybe here?

public float Jump = 20f;
private Vector2 DirectionDeplacement = Vector2.zero;
private PlayerController 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);

}
}

What’s the problem? Is there an error message? Does it just not do what you want it to do? If so, what does it do and what were you expecting it to do?

Also, use code tags (first sticky post on the forum).

3 Likes

You’re going to have to state what the problem is, but the fact you’re declaring a Jump variable but never using it is suspicious.

When I save the script, it doesn’t consider the Speed and The Jump variable. The rest works well but its like the jump code isnt’ there. So I think that the problem was there.

Sorry, only the Jump variable.

Well, there’s no “Speed” variable declared in the script you pasted, and you don’t use the “Jump” variable anywhere in the code, so yeah, it is indeed very much like the jump code isn’t there.

If the code you pasted is the entire script, I can see at least two things that are compile errors right away, so what compile errors do you have? Copy and paste them here, along with the full script, in code tags.

Thanks to you I found the problem it works.