Quantcast
Viewing all articles
Browse latest Browse all 2891

I'm trying to make a script for multiple hixboxes and if it has collision, text changes and stuff. But it has an error

using System.Collections; using System.Collections.Generic; using UnityEngine; public class txtScript : MonoBehaviour { public GameObject text1; public GameObject text2; public GameObject text3; public GameObject text4; //public GameObject hitbox1; //public GameObject hitbox2; //when the game starts void Start() { text2.SetActive(false); text2.SetActive(false); text3.SetActive(false); } //starts on trigger void OnTriggerEnter(Collider other) { if (Collider.gameObject.tag == ("hitbox1")) { text1.SetActive(false);//makes text1 disappear text2.SetActive(true);//this makes the text visible on trigger } text2.SetActive(false); text3.SetActive(true); text3.SetActive(false); text4.SetActive(true); } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>