Answers for "unity overlapsphere"

C#
1

Unity Physics.OverlapSphere

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
0

unity overlapsphere

Collider[] hitColliders = Physics.OverlapSphere(center, radius);
Posted by: Guest on July-09-2021

C# Answers by Framework

Browse Popular Code Answers by Language