I am working on a 2d space shooter and am trying to do inertial movement a la Asteroids. I got some code from a Youtube tutorial that I was able to get going, but when I replaced the art asset, the movement only works in the positive x direction. I am trying to get the movement to work forward in the direction the asset is rotated. What is causing my issue? Appreciate all help!
Sounds like you wrote a bug… and that means… time to start debugging!
By debugging you can find out exactly what your program is doing so you can fix it.
Use the above techniques to get the information you need in order to reason about what the problem is.
You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.
Once you understand what the problem is, you may begin to reason about a solution to the problem.
If you just need a fully functioning asteroids-style ship, here’s a project with various types in it, including a Spaceship2D and SpaceShip3D demo, fully setup, commented, operational.
The code:
Remember: code is a tiny part of the problem. How it is set up is equally (or more) critical.
Enjoy!!
proximity_buttons is presently hosted at these locations: