Playmaker Forum

PlayMaker News => General Discussion => Topic started by: Handrews on December 04, 2020, 09:20:49 AM

Title: Get GameObjects in a specific radius
Post by: Handrews on December 04, 2020, 09:20:49 AM
There is any way to get all gameobjects with an specific tag inside a circular radius? I tried using trigger event with a sphere collider but it only get one "enemy" at a time.
Title: Re: Get GameObjects in a specific radius
Post by: MlleBun on December 05, 2020, 06:27:14 AM
Hi,
You can use the Addon ArrayMaker (https://hutonggames.fogbugz.com/default.asp?W715) to create dynamic lists and ArrayListSortGameObjectByDistance (https://github.com/jeanfabre/PlayMaker--ArrayMaker--U4.3.4-SubModule-/blob/master/Addons/Custom/GameObject/ArrayListSortGameObjectByDistance.cs).
Title: Re: Get GameObjects in a specific radius
Post by: Alex Chouls on December 05, 2020, 10:53:40 AM
You can also use the Get Overlap actions available on the Ecosystem:
https://hutonggames.fogbugz.com/f/page?W1181
Title: Re: Get GameObjects in a specific radius
Post by: Prestonh on December 13, 2020, 03:15:44 PM
Ya, the idea of “getting” objects within a certain range isnt normal default function.    Find object by type or simular methods can b used, but they get everything, then you filter through the array of those by distance, overlap sphere  or overlap box are like a raycast in a area, that can get everything, which can use a layer mask, towhich you would just filter that array list by tag too.