// Start is called before the first frame update void Start() { // la variable rb2d hace referencia al rigidbody del objeto al que asignamos el script(inspector) rb2d = GetComponent <Rigidbody2D>(); controladorPJ = GetComponentInParent <ControladorPJ>();//accede al script controladorPJ del padre }
// Use this for initialization void Start() { controladorPJ = GetComponentInParent <ControladorPJ>(); }