For testing you can always just write buttonClickComp["stateAnimation"]
for example to set or access members
Feasible -Dynamically create everywhere Animation actions at runtime before opening Quick Look/WebXR
Is there anything else I need to do to set that PlayAnimationOnClick script up at runtime?
by user 103054507105067008
but you shouldnt set them at all
all you need to set it the target, animator, stateName and stateNameAfterPlaying. You can try it in the browser. Does this work?
The private variables are private because they are internal state that is assigne when exporting to usdz from the public variables
Iβm just testing in the browser, troubleshooting to see if anything else is breaking it first, the first animation autoplays and loops when I use the AnimatorController.createFromClips
which is a good start
by user 103054507105067008
You can disable this with the second parameter (it exposes some options)
How do you make a new CreateAnimatorControllerOptions
for that, I always get Cannot find name CreateAnimatorControllerOptions .
by user 103054507105067008
itβs just a type definition thatβs why you cannot create a new object with βnewβ. You pass it in like so AnimatorController.createFromClips(this.clips!, { <options_you_want_to_override> });
Okay so in my case it was specific scene hierarchy issue where the button for PlayAnimationOnClick was not in the hierarchy underneath the WebAR session root etc so I fixed it by moving the button there - Iβll share a sample when I can to help others if anyone else is making their own model viewer for AR
by user 103054507105067008