A cool addition would be to make the object pieces turn transparent / shrink over time before destroying them for a smoother effect. Very cool tutorial! Keep these videos going and you'll get to the top!
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Break : MonoBehaviour { public Rigidbody rb; public bool isBroken; // Start is called before the first frame update void Start() { rb.isKinematic = true; } // Update is called once per frame void Update() { if (isBroken == true) { rb.isKinematic = false; } } private void OnTriggerEnter(Collider other) { if(other.gameObject.tag=="Breaker") { isBroken=true; } }
A cool addition would be to make the object pieces turn transparent / shrink over time before destroying them for a smoother effect. Very cool tutorial! Keep these videos going and you'll get to the top!
That's a great idea
Nice job
Cool vid! Sub from me! 🥂
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Break : MonoBehaviour
{
public Rigidbody rb;
public bool isBroken;
// Start is called before the first frame update
void Start()
{
rb.isKinematic = true;
}
// Update is called once per frame
void Update()
{
if (isBroken == true)
{
rb.isKinematic = false;
}
}
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag=="Breaker")
{
isBroken=true;
}
}
}
Thank you so much