Tutorial or example for movement in 3D space?
I am trying to create a simple space game where the player controls a spaceship, and should be allowed to move in any direction in 3D space. The basic idea is to use the mouse to set direction and wasd to move forward and back. I've been trying to create this movement on my own, but I'm having trouble making the camera follow it (it's a child in heirarchy, still getting problems), and the direction of movement for the spaceship itself correctly. All tutorials I see with character movement are where character is moving on a plane, like a floor.
I don't need the physics part, I believe I should be able to add the effects of momentum and acceleration once I get the above right.
Thanks!
I fixed a couple of things: 1. Ins$$anonymous$$d of camera child of spaceship, I made spaceship child of the camera. Now the spaceship always remains centered in front of camera (currently I am using a sphere to represent that.) 2. I used camera's ViewportPointtoRay() function to set the direction of movement.
Don't need ViewportPointToRay(), as its in world space. Can just translate the z coordinate to move front back.
Just realized that rotation moves the spaceship, ins$$anonymous$$d of just rotating it around with translating it. Back to the drawing board!