Issue with events, script to script

I get the empty array instead of nodes of camera path what I do wrong?
When clicked the button there should be passed the nodes so then camera would rotate

// menu.js
const self = this;
btn.addEventListener('click', function(){'clickedBtn',});

// cameraAnim.js
const onClickedBtn = nodes => nodes = this.pathRoot.children;
this.on('clickedBtn', onClickedBtn);

I would check if cameraAnim.nodes was ever not empty or gets emptied at some point before the callback.

1 Like

Additionally this is based on the camera following path tutorial

Have you stepped through this with a debugger? Chances are that there may be a logic flow issue.