Screen FX on approach
I've been looking at the templates "on approach" and "look at" but I can't figure out how to achieve what I want to do.
What I want to do is to have a bonfire that you can place in your environment, then when you look at it or walk up to it, have some marshmallows on sticks come out of the side of the screen and point towards the fire, and also possibly have text appear.
So what I have done so far is to replace the 3D object with a looping gif billboard of a bonfire.
But I can't figure out how to make the proximity change a different object other than the one that you're approaching/looking at
Hey Samuel!
Cool idea! In the Interactive Approach Template the animation is driven by ApproachAnim.js. In this script you can notice that there are references to the animation mixer (script.api.animMixer) provided by IdleAnim.js.
In order to drive another object's animation, you can create your own animation mixer input.
At the top of ApproachAnim.js add this line:
Now, in the Inspector of WorldObjectController you will see a new input called Approach Mixer
Add the animation mixer you want to play there by pressing the field and selecting your animation in the popup.
Now we'll just need to tell ApproachAnim.js to use this animation mixer instead. Anywhere you see
replace it with
And now that animation should play instead!
Can't wait to see the result!
Cheers,
Jon