how to reference a child object unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ExampleScript : MonoBehaviour
{
// Private variables for referencing
private GameObject parentObject;
private GameObject childObject;
private void Start()
{
// referenences for the repawn pannel
parentObject = GameObject.Find("Parent");// The name of the parent object
childObject = parentObject.transform.GetChild(0).gameObject; // the parent index (starting from 0)
}
}
Also in C#:
- c# list string return concatenate
- how to allow user import image c#
- open file in explorer c#
- C# invoke
- c sharp list indexer
- c# md5 hash file
- same click event diffrenet buttonms c#
- c# serialize
- parsing string to int c#
- mouseposition unity
- c# input
- use enter key unity
- string to uint c#
- C# aspnet how to run a migration
- isGrounded script for copy
- button commandfield commandargument pass textbox
- unity how to move an object
- JavaScriptSerializer() and convert to base64
- c# loop through object
- c# thread sleep
- percentage in c#
- c# ?
- font family behind code uwp c#
- how to reload app.config file at runtime in c#