Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity get component in parent

void OnCollisionEnter(Collision collision)
{
PlayerController pl = collision.gameObject.GetComponentInParent<PlayerController>();
}
 
PREVIOUS NEXT
Tagged: #unity #component #parent
ADD COMMENT
Topic
Name
7+9 =