On Enter//Exit scene no event info

@jonathan , Daniel

While working on a project that contained On Enter Viewport actions, I was trying to catch the Enter/Exit events.

But just got undefined.

Figured out a work around using Custom Behaviour trigger Names.

But not sure if this is a known issue or even just a one off for me. (Not at Mac at mo)?
Been having a lot of oddness with Ventura and Hype.

Do you mean on enter viewport, or on scene load?

I'm not sure I know enough either way to say - can you send the project that exhibits the problem? (Also, please send your workaround project). Thanks!

sorry, did not notice I said scene.

It is viewport.

The Project was the one in

If we add console.log(event) to the function that's called

we get undefined.

I have put the console.log() in this one.

scroll-Symbol_MHv1 2.hype.zip (1.6 MB)

Thanks!

Due to the nature of how viewport actions work, there's not a "real" event; in fact even calling window.event will not give a defined one.

However, in this and a lot of other contexts, we generate "faux" events that usually have some of the fields filled in to give better context.

In fact, if you use the HYPE_eventListeners for the HypeEnterViewport or HypeExitViewport, you will get this faux event filled in. It does seem like a long standing bug that we don't use also put it in the javascript action handler.

I've fixed this for the next release. Thank you!

2 Likes

That's great news. :+1:
Thanks Jonathan.

1 Like

I should mention - the faux event only has a type field (of either HypeEnterViewport or HypeExitViewport). If there's anything more you need it won't be there, and you'd need to get it another way.

1 Like

Nope, thats all I was expecting.

1 Like