Answers for "unity overlap sphere"

C#
1

unity overlap sphere

using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
    void ExplosionDamage(Vector3 center, float radius)
    {
        Collider[] hitColliders = Physics.OverlapSphere(center, radius);
        foreach (var hitCollider in hitColliders)
        {
            hitCollider.SendMessage("AddDamage");
        }
    }
}
Posted by: Guest on June-19-2021

C# Answers by Framework

Browse Popular Code Answers by Language