- Home /
Speed issues, cannot change speed, Help
The following code is part of my script for my in game player movement (made in unity 2d). It kind of works, but I cannot change the speed (changes to public float speed has no impact on the actual speed when the game starts). I have been looking around but cannot find a solution. pls help.
public float speed = 1.5f;
void Update () {
var move = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
transform.position += move * speed * Time.deltaTime;}
Answer by $$anonymous$$ · May 11, 2015 at 03:47 PM
Hey, I've tested your code in my Unity5 but everything looks just fine, when I change that Speed variable from the editor during the game or at the start, It works fine.
Try restarting your Unity or Computer if it still doesn't work
it worked after restarting :) I totally worked myself up over this, so thanks for checking it
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Keep getting this error CS8025 1 Answer
Distribute terrain in zones 3 Answers
what else could be wrong, OnTriggerEnter 2 Answers
urgent, pls help. Selection through keyinput in Canvas 2 Answers