event parent problem

event parent problem
0

i have a problem i can reduce it by finding the object using cc.find
is that a bug or my mistake by me
Example(event, customEventData){
// this line sometimes work and sometimes not
event.target.parent.parent.getComponent(“Animation_controller”).Close()
}
},