My code is right but my Vector3 isn’t allowing me to move up. It’s just standing still
Hi Joe,
Welcome to our community!
There could be multiple reasons for this behaviour. First of all, have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture?
- Since C# is case-sensitive, make sure the Unity methods are spelt correctly.
- Make sure that all curly brackets are placed correctly.
- Make sure that your rocket gets enough thrust. For testing purposes, use a very high value. If the rocket moves, you know that your code is working as expected.
- If you exposed the
thrustSpeed
variable with [SerializeField], change the value in the Inspector because the Inspector controls the value, not the code. - Make sure that your script is attached to your rocket.
I hope one of my suggestions will help you solve the problem. If not, please let me know. Also bear in mind that I currently don’t know anything about your game, so if you need help, it would be great if you could share more information on what you did and have.
See also:
- Forum User Guides : How to apply code formatting within your post
- Forum User Guides : How to mark a topic as solved
It was the Rocket thrust, it was too slow. Thank you!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.