unity destroy all children

[ad_1]

unity delete all children
 foreach (Transform child in transform) {
     Destroy(child.gameObject);
 }
unity destroy all children
while (transform.childCount 0) {
    DestroyImmediate(transform.GetChild(0).gameObject);
}
Unity Destroy All Children
Read More

how to convert string to bool c#

[ad_1]

how to convert string to bool c#
 string sample = "True";
 bool myBool = bool.Parse(sample);

 ///or

 bool myBool = Convert.ToBoolean(sample);
c# string to bool
Console.WriteLine(Boolean.TryParse("false", out 
Read More

unity movetowards

[ad_1]

unity movetowards
float speed;
Vector3 goalPosition;

void Update()
{
	transform.position = Vector3.MoveTowards(transform.position, goalPosition, speed * Time.deltaTime); //goes from the position of the gameObject to the goalPosition 
Read More

how to change a image with code unity

[ad_1]

how to change a image with code unity
// Change From GameOject
public GameObject GameObjectWithImage;
public Sprite ImageYouWant;
GameObjectWithImage.GetComponent().sprite = ImageYouWant

// Change From Image
Read More

unity move left and right

[ad_1]

unity move left and right
public float speed = 0.2f

transform.position = new Vector3(transform.position.x+speed,
	transform.position.y, transform.position.z);

[ad_2]… Read More