using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnableJoyStick : MonoBehaviour { private MeshCollider _collider; private MeshRenderer _renderer; public GameObject LocomotionSystem; // Start is called before the first frame update void Start() { _collider = GetComponent(); _renderer = GetComponent(); LocomotionSystem.SetActive(false); } private void OnTriggerEnter(Collider other) { if (other.tag == "Hand") { LocomotionSystem.SetActive(!LocomotionSystem.activeSelf); } } }