I worked on my car in Unity yesterday and everything was fine, but now when I open my project today, my car model won't move at all, and there are no error messages to indicate what's wrong. I've got a RigidBody component and a CarPhysicsController attached, but I can't share my code here just yet. I plan to add it in a comment. I really need to fix this because my project is due tomorrow, so any advice would be greatly appreciated!
3 Answers
Unity can be a bit tricky sometimes, where things break without showing an error. Since you're using RigidBody and a custom controller, check if the physics settings or constraints might have changed, or if something is stopping the force from being applied. If you share a snippet of your code, it could help others identify the issue!
It would really help if you could share the complete code for your car. Maybe put it on GitHub or a gist? Also, just curious, what programming language are you using here?
I’ll try to upload it soon! I'm using C#, by the way.
Also, is ‘Void Awake()’ supposed to have a capital V? Just checking!
Try using the debugger in your IDE to step through the code and see how the values are changing. Sometimes that's the best way to find bugs that don't throw any errors!
I’m not familiar with debugging yet. Can you explain how to do that?
I’ve added my code in a comment! My physics settings haven’t changed since it was working. How do I check the constraints?