Created
October 21, 2021 01:41
-
-
Save curious-username/8f2311538d99ea6bc56e4f42d4db9fb3 to your computer and use it in GitHub Desktop.
thruster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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