Skip to content

Instantly share code, notes, and snippets.

@LottieVixen
Last active September 18, 2021 23:43
Show Gist options
  • Save LottieVixen/1dc59f6257e16400e5f1ce02494bff82 to your computer and use it in GitHub Desktop.
Save LottieVixen/1dc59f6257e16400e5f1ce02494bff82 to your computer and use it in GitHub Desktop.
#explaination and example (current) vector
#forward is a 0 or 1 indicating player intent
var thrust_force = Vector2(150, 0)
apply_impulse( Vector2.LEFT, thrust_force.rotated(global_rotation) * forward) #has a slight clockwise spin
apply_central_impulse( thrust_force.rotated(global_rotation) * forward) #works as expected, flies straight at the ship's heading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment