,I found this code in a youtube tutorial, and the speed is a little slow. I tried to increase the value of ‘movespeed’, but it didn’t seem to work.
I found this code in a youtube tutorial, and the speed is a little slow. I tried to increase the value of 'movespeed', but it didn't seem to work.,How do I increase the speed?
Code looks OK although mixing direct changes to transform position and physics (add force) isn’t always best (can cause odd behaviour when in collision and this might be the issue - object is in collision with surface). You might want to consider applying forces on the x axis the same way you are jumping. So not part of jump code, but similar apply force in x direction in “FixedUpdate” (not update as physics happier with fixed frame periods)
That said, it’s all about scale. Your move code means move at max 10 units per second depending upon horizontal axis deflection (delta Time is fraction of second per frame). So, if the scale of your scene is really big, a change in move speed might be unnoticeable.
It is a public float so maybe you have accidentally changed the value in the unity editor.
When you click on the object that has the script on it and look at it’s script component in the inspector window, then you can influence the value movespeed from there.
Sometimes the value gets stuck on whatever you set it to, when you change it in the script.
Try looking at the script in the inspector.