Character won't move, followed a tutorial

Hi, I’m new to learning coding and unity

but I followed a tutorial on how to make an endless runner game and in one part the instructor just added some new code lines without explaining.

Hi @ErfanWASD,

Lets start simple:
(1) Did you assign fowardSpeed and maxSpeed in inspector Tab?

1 Like

That’s why you also need to provide Editor screenshots and so on.
The more info you provide, the faster you will get a solution.

Hi again @ErfanWASD,

If (1) will not help…
(2) go to controller.Move, and add there this line

Debug.Log(_Vecotor3 Which Is Entry Parameter For Move Void);

Then when you expect to go forward, check did Move wass called and how input Vecor3 look like

Hope will do, let us know did you manage to solve your issue

Hello
First off, thank you for your response to my problem
I genuinely don’t know what the problem was but I expect it was some bug related to unity
because after I just copied the code and assigned it again it worked fine

Nah… sometimes coping code is not enough :blush: go with (1) probably you need assign this values because currently you using zeros as them… if this will not help go with (2).

as you can see here:

public float forwardSpeed;
public float maxSpeed;

someone who write it do not assign value. Design them as public to expose them in inspector for you, so you could change values even during Play Mode and check what values will be best

Yea it was zero on the inspector and had to manually change it, but now I’ve integrated it into the code so it starts with a value
Thanks!

1 Like