June 2018
Beginner to intermediate
298 pages
7h 38m
English
Add the following variables to the script:
export (int) var engine_powerexport (int) var spin_power var thrust = Vector2()var rotation_dir = 0
engine_power and spin_power control how fast the ship can accelerate and turn. In the Inspector, set them to 500 and 15000, respectively. thrust will represent the force being applied by the ship's engine: either (0, 0) when coasting, or a vector with the length of engine_power when powered on. rotation_dir will represent what direction the ship is turning in and apply a torque, or rotational force.
By default, the physics settings provide some damping, which reduces a body's velocity and spin. In space, there's no friction, so for realism there shouldn't be any damping at all. However, for ...
Read now
Unlock full access