- Home /
How do I create a spaceship
Iv'e been looking for ages and I can't find a spaceship script that will control my spaceship(the kind of spaceship I want is like the one on starwars battle front without the roll). I only need the spaceship to be-able to move (not shoot).(W = up, A = left, space = thrust...etc)
Why are you not trying to script it ins$$anonymous$$d of looking? You'll mostly just need to understand rigidbodies and their functions.
http://docs.unity3d.com/Documentation/Components/class-Rigidbody.html
http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.html
Answer by capcom · Sep 09, 2012 at 07:17 PM
Try something like this:
//amount to move player
amtToMove = playerSpeed * Input.GetAxis("Horizontal") * Time.deltaTime;
//move/translate player
transform.Translate(Vector3.right * amtToMove);
The above will move the spaceship/player up. Apply this same kind of thing to all four directions in the update function. playerSpeed is defined by you.
Your answer
Follow this Question
Related Questions
Player Controller Rotation Script Help 2 Answers
Rotation and force? 1 Answer
Forward movement rotated on movement script? 0 Answers
What is the cause of the distorted movement of my character? 0 Answers
Rotation used as movement 4 Answers