Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to disable a gameObject unity c#

public GameObject gameObj;//the gameobject you want to disable in the scene

        gameObj.SetActive(true); //set the object to active
        gameObj.SetActive(false);//set the object to disable

        gameObject.SetActive(true);//change the state of the current gameobject to active
        gameObject.SetActive(false);//change the state of the current gameobject to disable
Comment

deactivate a gameobject unity

public void SetActive(bool value);
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity 3d camera rotate up and down 
Csharp :: Animator.GotoState: State could not be found 
Csharp :: c# get all inherited classes of a class 
Csharp :: c# print to console 
Csharp :: c# for loop backwards 
Csharp :: how to move a object in unity c# 
Csharp :: unity distance between 2 vectors 2d 
Csharp :: unity key pressed 
Csharp :: c# convert dictionary to anonymous object 
Csharp :: bash if null or empty 
Csharp :: init dictionary c# 
Csharp :: serilog loglevel order 
Csharp :: easily start admin process from service c# 
Csharp :: string to enum c# 
Csharp :: c# list object to json 
Csharp :: c# read file into a string 
Csharp :: get random number c# 
Csharp :: c# string capital first letter extension method 
Csharp :: remap float c# 
Csharp :: c# require administrator permissions 
Csharp :: system.text.json DeserializeAsync when to use 
Csharp :: get apps execution path with app name c# 
Csharp :: assign datasource to dropdownlist in c# 
Csharp :: axwmp balance c# 
Csharp :: vs code explorer font size 
Csharp :: unity c# class addition syntax 
Csharp :: c# datagridview color header 
Csharp :: c# thread wait 
Csharp :: get the current directory in unity 
Csharp :: unity get a position inside sphere 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =