GetComponent Flashcards

1
Q

private Rigidbody playerRb;

public float gravityModifier;

A
void Start()
{
playerRb = GetComponent< Rigidbody > ();
Physics.gravity*=gravityModifier;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

private float repeatWidht;

A
void Start () 
{
repeatWidht = GetComponent < BoxCollider >().size.x /2;

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

private Animator playerAnim;

A

(Start) playerAnim = GetComponent < Animator >();

(Update) playerAnim.SetTrigger(“Jump_trig”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly