get gameobject by name
C#
using UnityEngine;
using System.Collections;// This returns the GameObject named Hand in one of the Scenes.public class ExampleClass : MonoBehaviour
{
public GameObject hand; void Example()
{
// This returns the GameObject named Hand.
hand = GameObject.Find("Hand"); // This returns the GameObject named Hand.
// Hand must not have a parent in the Hierarchy view.
hand = GameObject.Find("/Hand"); // This returns the GameObject named Hand,
// which is a child of Arm > Monster.
// Monster must not have a parent in the Hierarchy view.
hand = GameObject.Find("/Monster/Arm/Hand"); // This returns the GameObject named Hand,
// which is a child of Arm > Monster.
hand = GameObject.Find("Monster/Arm/Hand");
}
}
Also in C#:
- Title
- unity how to rotate something to point to something else
- Category
- C#
- Title
- c# variable
- Category
- C#
- Title
- linq foreach c#
- Category
- C#
- Title
- decalre an int list mvc
- Category
- C#
- Title
- create new object from generic c#
- Category
- C#
- Title
- cannot convert string to generic type c#
- Category
- C#
- Title
- comments unity c#
- Category
- C#
- Title
- vb.net check if datatable has rows
- Category
- C#
- Title
- add row and columns to grid wpf in code
- Category
- C#
- Title
- how to raycast unit
- Category
- C#
- Title
- interpolate rotation unity3d
- Category
- C#
- Title
- instantiate object in circle
- Category
- C#
- Title
- how to make an object move in unity
- Category
- C#
- Title
- unity lerp
- Category
- C#
- Title
- how to find object by ag unity
- Category
- C#
- Title
- how to sort string array alphabetically in c#
- Category
- C#
- Title
- c# odd even median
- Category
- C#
- Title
- asp list box
- Category
- C#
- Title
- c# mathf.ceiling
- Category
- C#
- Title
- chase object unity
- Category
- C#
- Title
- use newtonsoft json to clone object
- Category
- C#
- Title
- convert array object to int[] c#
- Category
- C#
- Title
- c# number suffixes
- Category
- C#
- Title
- unitt only 1 number float
- Category
- C#
- Title
- c# razor add disabled to button if
- Category
- C#
- Title
- unity transfoprm position y change
- Category
- C#
- Title
- unity getcomponent
- Category
- C#
- Title
- how to store some variables on the device in unity
- Category
- C#
- Title
- c# check internet connection easy
- Category
- C#
- Title
- isprime c#
- Category
- C#
- Title
- Failed to retrieve Firebase Instance Id
- Category
- C#
- Title
- unity custom update
- Category
- C#
- Title
- 5 second timer in c#
- Category
- C#
- Title
- unity c# get bool from another script
- Category
- C#
- Title
- c# linq join multiple conditions
- Category
- C#
- Title
- decimals not stored in azure tables
- Category
- C#
- Title
- c# inheritance constructor
- Category
- C#
- Title
- how to make a string a list of characters c#
- Category
- C#
- Title
- out parameters c#
- Category
- C#
- Title
- c# get gridview DataKeyNames
- Category
- C#
- Title
- how to stop window from terminating c# visual studio
- Category
- C#
- Title
- how to add array to list in c#
- Category
- C#
- Title
- c# how to run external program with args
- Category
- C#
- Title
- c# dictionaries
- Category
- C#
- Title
- c# relaxed boolean cast
- Category
- C#
- Title
- c# reverse a string
- Category
- C#
- Title
- get random value from list c#
- Category
- C#
- Title
- c# add object to array
- Category
- C#
- Title
- .net core download image from url binary file
- Category
- C#
- Title
- c# console delay
- Category
- C#
- Title
- docker ssh
- Category
- C#
- Title
- unity get data from firebase
- Category
- C#
- Title
- datatable return column names
- Category
- C#
- Title
- c# update control from another thread
- Category
- C#
- Title
- unity check when clicked on object
- Category
- C#
- Title
- c# anonymous class
- Category
- C#
- Title
- Length = '((System.Net.RequestStream)RequestStream).Length' threw an exception of type 'System.NotSupportedException'
- Category
- C#
- Title
- unity fps counter
- Category
- C#
- Title
- add new page to site c# programmatically
- Category
- C#
- Title
- unity main texture not working
- Category
- C#
- Title
- unity rigidbody constraints
- Category
- C#
- Title
- c# generate random number
- Category
- C#
- Title
- C# get pc language
- Category
- C#
- Title
- c sharp split by newline
- Category
- C#
- Title
- unity rotation
- Category
- C#
- Title
- unity how to see what scen you are in
- Category
- C#
- Title
- c# delay
- Category
- C#
- Title
- length of a string c#
- Category
- C#
- Title
- .sh script: check if file exist
- Category
- C#
- Title
- external font family uwp c#
- Category
- C#
- Title
- c# create new object
- Category
- C#
- Title
- unity 2d Drag object
- Category
- C#
- Title
- unity detect any key
- Category
- C#
- Title
- c# find duplicates in list of strings
- Category
- C#
- Title
- c# console writeline color
- Category
- C#
- Title
- c# print expression tree
- Category
- C#
- Title
- fly cam extended script unity 3d
- Category
- C#
- Title
- generate a dropdown list from array data using razor .net mvc
- Category
- C#
- Title
- unity load scene
- Category
- C#
- Title
- unity make a int arry with preset values
- Category
- C#
- Title
- c# remove time in datetime
- Category
- C#
- Title
- block wapalyzer from detecting codeigniter
- Category
- C#
- Title
- c# mixed multidimensional array
- Category
- C#
- Title
- C# for
- Category
- C#
- Title
- c# double question mark
- Category
- C#
- Title
- c# properties
- Category
- C#
- Title
- c sharp check if key in dictionary
- Category
- C#
- Title
- unity docs player input
- Category
- C#
- Title
- how do I attach a player with a navMeshAgent
- Category
- C#
- Title
- c# creating exceptions
- Category
- C#
- Title
- how to find the area of a circle
- Category
- C#
- Title
- c# clear list items
- Category
- C#
- Title
- c# one line set
- Category
- C#
- Title
- convert number of days into months c#
- Category
- C#
- Title
- c# remove first 5 characters from string
- Category
- C#
- Title
- write last line txt file c#
- Category
- C#
- Title
- choose random gameobject from a gameobject list
- Category
- C#
- Title
- c# convert to nullable datetime
- Category
- C#
- Title
- .net core cli
- Category
- C#
- Title
- make camera follow character unity 2020
- Category
- C#