That’s really trivial.
You simply keep a velocity vector by which you translate the ship on every update (multiply it by Time.deltaTime to be framerate independant).
Then, you’ll rotate the ship left or right around the camera-facing axis while the respective arrow key is pressed.
Finally, while thrusting, you add the forward vector of the ship, multiplied by some constant and by Time.deltaTime, to your velocity vector.
I should have mentioned I’m not very good at coding. I can understand what I need to do but implementing this isn’t my strong point. So far I can move the object up and to the right. Left and down doesn’t seem to work.
Thanks but I’d rather not pay $50 to look at some code
first. its not only the code but assets, prefabs etc. so a good start for a similar project in any case.
second. you asked for a reference. not for a free one.
this is the best starting point you can get. if you refuse to use it good luck. it will take you some time to collect the required knowledge step by step and requires helpfull people in the forums. don’t know if you can always rely on that.
I have managed to get my movement and I have come across a weird problem. Whenever my object collides with another, say a wall, it just spins out of control and continues to just spin.
Does this mean I have to limit what axis it can move on? If not, how do I get fix this problem?
I made a game like this (Asteroids 2.5D) a earlier this year.
Be sure to lock the 3rd dimension axis of your spaceship and items in the game on the rigid body. By this, I mean if you are using the X and Y axis for your game, then lock everything on the Z-axis so they can’t move in that dimension (towards or away from camera).
When dealing with spaceship movement and propulsion in 2D, I simply just applied forward force to the ship when [up arrow] was pressed or held down to propel it forward. The [left arrow] and [right arrow] just simply rotated the ship along it’s 3rd dimensional vertical axis.