- Home /
Question by
09millarda · May 18, 2012 at 10:14 PM ·
movementfpsspaceflight
Space Flight Script
Hi there, i am new to unity and i have been looking round for around 2 hours to try and find a space flight script. I am making a space FPS game and i need a basic script to move my shuttle. W for basic movement and the Space Bar to increase my throttle. Please help. A S D
Comment
Answer by Lo0NuhtiK · May 21, 2012 at 05:41 AM
public speed as single = 0
def Update () :
transform.Translate(Input.GetAxis("Horizontal") * speed * Time.deltaTime, 0, Input.GetAxis("Vertical") * speed * Time.deltaTime)
if(Input.GetKeyDown(KeyCode.Space)) : //tap to speed up
speed += 10
if(Input.GetKeyDown(KeyCode.B)) : //tap to slow down
speed -= 10
...about as basic as it gets.
Your answer
Follow this Question
Related Questions
Smooth Space Flight Script 1 Answer
Fps player control movement script 1 Answer
Space Invaders movement? 1 Answer
How to make object fallow the mouse ?? 1 Answer
Space Skybox implementation 5 Answers