GetComponent Flashcards
1
Q
private Rigidbody playerRb;
public float gravityModifier;
A
void Start() { playerRb = GetComponent< Rigidbody > (); Physics.gravity*=gravityModifier; }
2
Q
private float repeatWidht;
A
void Start () { repeatWidht = GetComponent < BoxCollider >().size.x /2;
}
3
Q
private Animator playerAnim;
A
(Start) playerAnim = GetComponent < Animator >();
(Update) playerAnim.SetTrigger(“Jump_trig”);