Click for Animation - How does it work?

Can someone explain how this on click animation works step by step?
Like what component should i add into scene or what code?

Or any direction I should work on? Anything would be helpful :hugs: .

Original Post on Discord

by user 786526940349726730

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

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

Changed the channel name: Click for Animation - How does it work?

Hey, I would appreciate if you explain it :grinning:

by user 786526940349726730

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

by user 786526940349726730

Oh im sorry for having forgotten to reply you :PandaSad:

That sounds something failed while cloning the project and you’re missing some assets.

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

I truly grateful for your time, Thank you :PandaPainter:

by user 786526940349726730