P
P
PomogiteMne214122021-01-20 18:18:54
Unity
PomogiteMne21412, 2021-01-20 18:18:54

Eror 1061 what to do?

using UnityEngine;

public class ExplodeCubes : MonoBehaviour {
    
    private bool _collisionSet;
    
    private void OnCollisionEnter(Collision collision) {
        if(collision.gameObject.tag == "Cube" && !_collisionSet) {
            for(int i = collision.transform.childCound - 1; i >= 0; i--) {
                Transform child = collision.transform.GetChild(i);
                child.gameObject.AddComponent<Rigidbody>();
                child.gameObject.GetComponent<Rigidbody>().AddExplosionForce(70f, Vector3.up, 5f);
                child.SetParent(null);
            }
            Destroy(collision.game0bject);
            _collisionSet = true;
        }
    }

  }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-01-20
@PomogiteMne21412

As in childhood they joked "What to do? Fart and run."
Look for a bug that! Even without specifying the line 0 is not visible, and the unit also writes the exact line to you. And IDE also directly underlines the wrong word.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question