UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"Create a script that when you click a part it will open up a UI."
using UnityEngine; using UnityEngine.UI; public class ClickToShowUI : MonoBehaviour { public GameObject targetUI; private void Start() { // Ensure the UI is hidden at the start targetUI.SetActive(false); } private void OnMouseDown() { // Toggle the UI visibility when the object is clicked targetUI.SetActive(!targetUI.activeSelf); } }