How to enable 3D screen after clicking box

How to realize the effect of 3D screen display after clicking box? (The 3D screen is hidden by default).


Overview | Dashboard | test about the 3d screen | PlayCanvas | 3D HTML5 & WebGL Game Engine

Hi @conner,

Take a look at this example on how to add button functionality to any UI element (that works for both 2D and 3D screens):

https://developer.playcanvas.com/en/tutorials/ui-elements-buttons/

From there you can listen to the button click event and act on it by enabling your 3D screen entity:

screenEntity.enabled = true;
2 Likes

Hi @Leonidas ,
Thank you very much for your reply
Can I use script A to control (entity.script.hidden) in script B?PLEASE
code

Yes, you can communicate between two scripts, check this manual page on how to do that:

https://developer.playcanvas.com/en/user-manual/scripting/communication/

Thanks :slight_smile:

1 Like