#Click for Animation - How does it work?

1 messages · Page 1 of 1 (latest)

rancid prairie
faint stag
#

Hi, have you tried downloading the sample project? It contains the scene 🙂

I can otherwise explain the key components too once im at the pc 🙂

faint stag
#

Click for Animation - How does it work?

rancid prairie
#

Hey, I would appreciate if you explain it 😀

rancid prairie
#

It's me again. I tried using samples by cloning. But console says ------_______--------- "Prefab instance problem: sci-fi_computer (Missing Prefab with guid: 4226a96b591d1a940a6e235573cc8aea)"

faint stag
#

Oh im sorry for having forgotten to reply you PandaSad

faint stag
#

Maybe try with a fresh clone ? I assume you opened the Needle Engine Samples project that comes with the repository (using Unity 2020.3?)

#

So the basic setup for opening closing the computer is this:

  1. the animator is used to play the animation for the computer to open <> close. It useses paramters and some simple transitions. A trigger is enabled using the Button (2)

  2. the button component can be used for scene objects too. The onClick method sets the Toggle trigger on the animator

  3. the ObjectRaycaster is required so that the button component receives the click event (it must be in the parent hierarchy of objects that you want to receive click events for via the IPointerEvent interfaces (which the Button component implements)

#

The IFrameContent is a sample script that generates some html to render the content of another website (here some youtube link - you can change it to whatever you want) using a threejs CSS3DRenderer