Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

make an object disappear from a c# script unity

public GameObject ObjectToDisappear;

void Start()
{
	ObjectToDisappear.GetComponent<Renderer>().enabled = false;
}
Comment

how to make an object appear and disappear in unity

void Update() {
   if (Input.GetMouseButtonDown(0)) {
     gameObject.active = true;
   }
   if (Input.GetMouseButtonDown(1)) {
     gameObject.active = false;
   }
 }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# reverse a string 
Csharp :: C# get enum value by DescriptionAttribute 
Csharp :: data table rename column c# 
Csharp :: cinemachine namespace not working 
Csharp :: cshtml foreach 
Csharp :: unity object to mouse 
Csharp :: transform.rotate unity 
Csharp :: newtonsoft json conditionally ignore property 
Csharp :: unity change material 
Csharp :: loop over all values in enum 
Csharp :: random seed in c# 
Csharp :: c# class to byte array 
Csharp :: c# get month number from name 
Csharp :: check strings is equal shell 
Csharp :: prettier inst working c# 
Csharp :: c# winforms textbox cursor position 
Csharp :: validate data exist in database lara vel 
Csharp :: unity dictionary check if key exists 
Csharp :: cs entity framework 
Csharp :: enable fullscreen unity code 
Csharp :: download file from url asp net web api c# 
Csharp :: difference between while and do while in c# 
Csharp :: c# hello world 
Csharp :: write text files with C# 
Csharp :: get 2d rotation from 2 position math 
Csharp :: triangle minimum path sum 
Csharp :: add object to list c# 
Csharp :: how to change the axis of a Vector3 variable 
Csharp :: keybyvalue c# 
Csharp :: how to create a singleton in unity 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =