The same Toggle button setup works as expected in scenes without Needle.JS.
Is the Unity Toggle button supported in Needle.JS, or is there additional setup required for compatibility?
Steps to Reproduce: Add a Toggle button in a Needle.JS-enabled scene, assign an event listener, and observe its non-functionality.
It seems the Unity UI Toggle button may require additional setup to work correctly in a Needle.JS-enabled scene. The common issues with UI elements in Needle Engine are often related to how event handling is configured, especially in scenes where Needle Engine manages rendering and event systems differently compared to standard Unity scenes.
Steps to Check and Implement:
Event Handling: Ensure that the EventSystem component is present in your scene. Without it, UI elements like the Toggle wonβt receive events.
Raycasting: Verify that the objects involved have appropriate colliders and are set up correctly for raycasting. The toggle needs to be interactable and there must be a raycaster set up on the UI system.
Ensure Clickable: Use the SetActiveOnClick component for basic interactivity, ensuring that each clickable element in your UI is properly configured. The following function will help ensure your UI element can be clicked:
Debug: Use debug logs to confirm that event listeners are firing correctly. You can attach a listener to the Toggle to output a message when the value changes:
Check Compatibility: If the above troubleshooting steps donβt resolve the issue, consider checking the Needle Engine documentation for any updates regarding support for Unity UI elements, as compatibility can evolve with new releases.
If these steps donβt address the problem, more specific details about versions and configurations can help narrow down the compatibility or setup issues further.
Generally you should see a blue link label mentioning needle engine at the top of the component (e.g. when you select a MeshRenderer for example) which indicates that the component is exported to the web.