Skip to content

Instantly share code, notes, and snippets.

@curious-username
Created October 21, 2021 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curious-username/8f2311538d99ea6bc56e4f42d4db9fb3 to your computer and use it in GitHub Desktop.
Save curious-username/8f2311538d99ea6bc56e4f42d4db9fb3 to your computer and use it in GitHub Desktop.
thruster
[SerializeField]
private GameObject _thruster;
private float _speed = 5.5f;
void Update()
{
Thrusters();
}
void Thrusters()
{
if (Input.GetKey(KeyCode.LeftShift))
{
if(_thruster != null) {
_speed = 8f;
_thruster.SetActive(true);
}
}
else
{
_speed = 5.5f;
_thruster.SetActive(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment