My sprite of the car just stopped to move, and I don’t know why. I tried to write the code again and again, tried to see and copy the instructor’s code again but doesn’t work. I run out of ideas. Any one knows what’s happen?
Hi Terezu, welcome to the community. It looks like you need to save the script so that it will recompile. When you change anything in VS, you need to save before going back to Unity.
I saved and nothing changes. Maybe I’m doing something wrong on Unity, I don’t know. Something that I noticed is that my “transform” before “.Rotate” and “.Translate” isn’t blue like in the instructor’s video, I don’t know if this can means something or not. Either is the “steerSpeed” and “moveSpeed”.
I’m lefting the print from my Unity screen just in case that I’m doing something wrong on Unity.
From what I saw, everying should be right.
Since now, I’m glade for the support.
You have the move speed set to 0.1f. Maybe it needs to be higher. It could be that the capsule is moving very slowly. Try setting it to 1.0f.
Here are few things to try as there’s nothing inherently wrong with the code:
- As mentioned earlier make sure to recompile your scripts
- In the menu, go to
Edit -> Project Settings -> Input Manager
, expand the first drop-down menuHorizontal
&Vertical
& make sure that theName
matches the one you entered as a string reference in your code - Restart Unity
Let me know how that goes
I tried everything you guys said, and still isn’t working. I tried to reiniciate my notebook, the Unity
So, I tried to remake the code by remaking from the benning re-wathing all the lessons, e then I discovered that Unity is not recognizing my keyboard inputs. Any one knows how to resolve this?
Is there an EventSystem in your Hierarchy? If not, add one. Then test your game again and let us know if Unity recognises the user input.
The best would be to also share a screenshot of what you did. While you wrote that you tried what we suggested, there is always a chance that you misunderstood us, or that there is a difference in your version of Unity compared to our version, and so on.