IOS click events not triggering

My click events work in safari and chrome. But when I fire up quicklook, the model does not register click events on buttons.

What exactly registers the click events in the quicklook USDZ file?
Is it a raycast and a mesh?
And when does this get blocked?
What is a good practise for USDZ click events?

For instance, do I need colliders / meshes on buttons?

Original Post on Discord

by user 365574199844274177

Hello there – we have an experimental AI bot :robot: that might be able to help you with your question. Would you like to try this out?

Hey there! QuickLook has its own internal raycasting engine, it’s effectively a black box. We can just provide it with triggers (e.g. “tap this object”) and actions (e.g. “play an animation/sound”)
You don’t need any colliders/buttons - but one thing to keep in mind is that QuickLook seems to treat all objects as colliders and approximates them with what I believe to be box-shaped boundaries

So in some cases you get better behaviour by splitting up meshes so that their axis-bounding boxes are smaller, and also sometimes you may need to add invisible objects as triggers that extend beyond what your visible button is.

An invisible trigger can e.g. be an object with opacity = 0 and alpha masking = 0.5 (so it ends up being invisible but can still be tapped and trigger events in QuickLook)

Okay interesting, thanks.

by user 365574199844274177

I’ll try some different things

by user 365574199844274177

I also have some issues when I use the everywhere action to activate an object, instead the trigger (button) gets deactivated after clicking. SO it seems that it is stuck on “hide self”

as if the script is compiled without serializations.

by user 365574199844274177

I had similar problem with “Toggle On Click” (I will send a bug report next week, I promise). I had the impression, that the click fires twice, and if “toggle on click” it activates the target, and then deactivates it in the next frame. Out of curiosity -
@The camel does it activate your “Active”-Target correctly, if you remove the checkmark from “toggle on click” ?

by user 743203108271816774

I’ll look at it. I don’t think there’s a way a click can fire twice in USDZ at all, but I’ll try to reproduce

I will try and let you know!

I had also issues with animations not looping, but that could be something else. I just struggle with the USDZ pipeline in general but that could be me :melting_face:

by user 365574199844274177

Yes, When I have Toggle On Click on false, it works as it should work. So it’s just click to activate.

But when I try to activate and deactivate targets I need Toggle On Click on true. In this case the object with the script dissapears if tapped. Perhaps due to an error the object gets deleted?

by user 365574199844274177

If you want to report a bug about animations not looping feel free

Next release will have significantly better SetActiveOnClick and Toggle behavior. There’s a few caveats that I’ll try to document better (that were already there before but made things pretty uncontrollable in some of the cases you described)

@The camel and @krempel if you can would be great if you test the latest release and check if it improves these cases for you. Thanks!

Please open new threads if there’s more questions / issues :slightly_smiling_face:

@herbst🌵 Works much better so far, I used toggle and invisible triggers.

by user 365574199844274177

One thing is strange, when toggle is active I cannot change the other bools, but I can when toggle is on false. Perhaps this is on purpose. Also if you make documentation about this, can you add what the Target State toggle does?

Thanks for this update! makes my life already much easier.

by user 365574199844274177

Glad to hear! Yes, this is intentional as these options are implicit when you’re using “toggle on click”

They should all have tooltips if you hover over the property names – let me know if that clears things up!

oh yeah, missed that. Thanks again!

by user 365574199844274177