playMaker

Author Topic: Find Closest game object by "Layer" instead of Tags? Plase help me.  (Read 1972 times)

Silicon Power

  • Full Member
  • ***
  • Posts: 185
Hi there guys. I have more than 10,000 of empty game object in my scene and I've mentioned I there is frame rates drops when I set a tag on them! but it's good with layer!!!

So is there a "Find Closest GameObject" action that uses Layer instead of tags?

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Find Closest game object by "Layer" instead of Tags? Plase help me.
« Reply #1 on: January 12, 2019, 10:32:52 AM »
No such ability exists natively in Unity. You can find the closest and then check its layers (using a separate action).

Link to the tag issue? Anyways, checking a gameobjects layer wouldnt be any faster than checking its tag.

Silicon Power

  • Full Member
  • ***
  • Posts: 185
Re: Find Closest game object by "Layer" instead of Tags? Plase help me.
« Reply #2 on: January 12, 2019, 11:36:17 AM »
No such ability exists natively in Unity. You can find the closest and then check its layers (using a separate action).

Link to the tag issue? Anyways, checking a gameobjects layer wouldnt be any faster than checking its tag.

Thanks. It seems I can't use find the closest action anymore because it reduce frames when it go to find a object between 10,000 of other objects.

Anyway I'm thinking for another method but don't know how should I do that!

I wan't to disable all my empty objects or fsm on the object and enable some of those only around my character. So I'm going to use trigger enter but how can I get those objects inside a trigger?
« Last Edit: January 12, 2019, 11:43:02 AM by Silicon Power »

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Re: Find Closest game object by "Layer" instead of Tags? Plase help me.
« Reply #3 on: January 12, 2019, 01:38:41 PM »
Download Find Closest 2 from Ecosystembrowser ;)