Question by
MTDues · Aug 02, 2017 at 12:10 AM ·
c#script.scripting beginnerscriptingbasics
Need to Change this script function , please
Hello the script is
using UnityEngine; using System.Collections;
public class ActiveT : MonoBehaviour {
public GameObject obj;
public int sins = 0;
public bool num;
void Start () {
}
void Update () {
if (sins == 1) {
num = true;
}
if (sins == 0) {
num = false;
}
if (Input.GetKeyDown (KeyCode.T) && sins >-1) {
obj.active = false;
sins += 1;
}
//================================
if (Input.GetKeyDown (KeyCode.T) && num == true) {
obj.active = true;
sins = 0;
}
}
}
basicly turnoff obj when press T
i want to make rather than pressing, make it Turnoff as it does but when it enters a Trigger
So when i Enter a trigger it turns off the obj
hope u guys know what i mean ty
Comment
Your answer
Follow this Question
Related Questions
Could someone translate these to c#? 1 Answer
Set public gameobject by raycast hit target 1 Answer
Set Bool to false after seconds? 2 Answers
Change button position using script 2 Answers