Created
June 1, 2016 06:58
-
-
Save ThinhHB/b8d199590884fc4b2ae28b0e3d89ecd3 to your computer and use it in GitHub Desktop.
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
// DO | |
Rigidbody _myRigidbody; | |
Transform _myTransform; | |
void Awake() | |
{ | |
_myRigidbody = GetComponent<Rigidbody>(); | |
_myTransform = transform; | |
} | |
void Update() | |
{ | |
_rigidbody.velocity = ... | |
_myTransform.position = ... | |
} | |
// DONT | |
void Update() | |
{ | |
GetComponent<Rigidbody>().AddForce()... | |
transform.position = ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment