Stratégie de référent : les stratégies les moins restrictives, comprenant « no-referrer-when-downgrade », « origin-when-cross-origin » et « unsafe-url » seront bientôt ignorées pour la requête intersite : CodePen - My Carouselindex555.html
**ERROR 1 : when enterring inside area **
Error: An unexpected error occurred spoofer.js:1:38935
Le script à l’adresse « https://widget.time.is/r/?nofollow.w0.h39. » a été chargé alors que son type MIME (« text/html ») n’est pas un type MIME JavaScript valide.
**ERROR 2 : when leaving area **
Error: Promised response from onMessage listener went out of scope
So the first entry is working, but the leaving is not working, and the second entry is not working, etc.
This is likely because you’re disabling the script that the onTriggerEnter and onTriggerLeave functions are on. The script needs to be enabled in order for the collision callbacks to fire.
I’d recommend that you don’t disable the script entirely. Keep the script enabled and set a boolean isColliding attribute inside the onTriggerEnter and onTriggerLeave functions. Then in other parts of your code, you can use the isColliding value to enable/disable functionality.
Thank u Devortel for your reply. As you can see on this screenshort, i try to control supertonton by name, and i want to activate it (iframePlane from supertonton entity) when entering area and disable “supertonton” script when i leave the aera. I share with you and with Leonidas my project, maybe you can look at it and tell me what’s wrong ?
Thanks a lot for your help, i appreciate !
What i want to do is to switch on the screen when enter the area and switch off the screen when leaving area. And i want to do it in loop of course switch on TV then switch off TV, switch on TV, etc. This is unfortunately not working…
Hey, so the screen has a html element which can not be hide by just disabling the script. You will have to find the element of the video and then disable it’s view.
You’ll want to avoid disabling the script that’s controlling the TV because this also disables all the functionality that the script contains. I’d recommend keeping the supertonton script enabled in the editor and then simplifying your letestingoui.js functions like so.
Hey @N1MP , i have resolved the issue for you in this project : https://playcanvas.com/editor/scene/1262677
Basically the html elements doesn’t disable with disabling the entity so you have to find the element by id and then enable/disable it.
Thank u, i this is a nice method to show or not to show that is the question ha ha ^^
but what i need is to disable the script, then to enable the script. Because it make a conflict with another script. When both script are on, it doesn’t work. So what i need to do is to disable the script when i’m in the area zone collider of the second script to disable the other to cancel the script conflic.
First script : iFRAME on a plane
Second script : HTML content shown on the screen
When the two scripts are “ON” it’s not working. But if the iframe script is OFF there is no problem.
Maybe i can create a scene to show you this ? what to you think ?
Right now, your problem is that when you’re disabling the iFrame, you’re also disabling the collision component as well as the onTriggerEnter and onTriggerLeave callbacks.
If the iFrame script has to be disabled. You need to put the collision component AND the script containing the onTriggerEnter and onTriggerLeave functions on a different entity that doesn’t get disabled with the iFrame. I’d recommend keeping the collision component and script where it is and then moving the iFrame script into a new, child entity. Then you can enable/disable the child entity without affecting the parent’s collision.
Looking at your modified iframeplane code, you are ultimately missing the logic that listens for when the script instance is disabled/enabled to hide/show the iframe.