Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity find gameobject by name

GameObject enemy = GameObject.Find("enemy");
Comment

unity find object by name

    public GameObject FindChildRecursive(GameObject parent, string childName) {
        foreach(Transform child in parent.transform) {
            if(child.name == childName) {
                return child.gameObject;
            } else {
                if(child.childCount > 0) {
                    GameObject result = FindChildRecursive(child.gameObject, childName);
                    if(result != null) return result;
                }
            }
        }
        return null;
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to make a enter in C# string 
Csharp :: datatable to array c# 
Csharp :: c# see if list contains any duplicates 
Csharp :: Unity Interstitial ad C# 
Csharp :: c# clear all textboxes 
Csharp :: how to save a dictionary as a csv file in c# 
Csharp :: if file exist rename c# 
Csharp :: calling stored procedure in c# entity framework 
Csharp :: convert xml string to file c# 
Csharp :: unity no serializefield 
Csharp :: how to make button in asp.net to go to other page 
Csharp :: asp.net model 
Csharp :: how to make a character run in unity 
Csharp :: how to check type c# 
Csharp :: how to get keyboard input in unity 
Csharp :: C# redirecttoaction with area 
Csharp :: c# random 
Csharp :: unity keep screen always on 
Csharp :: c# is odd number 
Csharp :: if debug c# 
Csharp :: c# switch statements 
Csharp :: what is a model in c# 
Csharp :: cast char[] to string c# 
Csharp :: cs string to enum 
Csharp :: c# string console readline array 
Csharp :: parse strings into words C# 
Csharp :: run file windows forms 
Csharp :: how to remove all comma from string c# 
Csharp :: C# Read() and ReadKey() 
Csharp :: c# combobox lock edit 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =