How can I return a object from EventHandler?

Hello, I have a question, how can I return a object I got from the event?
I want to output the CameraLocation when I zoom in/ zoom out or rotate the camera. And here is my code, I want to deliver the parameter “camLoc” to the parameter “ref object A”. Thanks a lot!

You’ll have to store the new camera data in a class level field, then expire the component and inside the RunScript method assign that class level field to your A parameter.

But note, triggering solutions is a slow process compared to rotating/panning the view. You may want to bake in some timed delays to avoid triggering too many updates. And you’ll definitely need to make sure that you don’t trigger updates if the new data is the same as the old data.

Wait… what event are you handling with Foo?