Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kavery on February 02, 2019, 11:39:53 AM

Title: Find Closest Game Object vs Get Closest In Array (performance[SOLVED]
Post by: kavery on February 02, 2019, 11:39:53 AM
Is it faster to use get closest within an array vs finding by tag? If so is it significantly different in overhead?

Thanks   8)
Title: Re: Find Closest Game Object vs Get Closest In Array (performance)
Post by: tcmeric on February 02, 2019, 12:00:40 PM
Finding it from an array will always be faster, because its a smaller pool of objects to search through. However, depending on how often you are doing the task, it may not be an issue. Its not something you want to do everyframe however.

How fast or slow depends on how many gameobjects you have in the scene. Find by tag is not as bad as find gameobject by name. Which tends to be the worst.