playMaker

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

Silicon Power

  • Junior Playmaker
  • **
  • Posts: 54
    • View Profile
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: 683
    • View Profile
Re: Find Closest game object by "Layer" instead of Tags? Plase help me.
« Reply #1 on: January 12, 2019, 08: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

  • Junior Playmaker
  • **
  • Posts: 54
    • View Profile
Re: Find Closest game object by "Layer" instead of Tags? Plase help me.
« Reply #2 on: January 12, 2019, 09: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, 09:43:02 AM by Silicon Power »

heavygunner

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Find Closest game object by "Layer" instead of Tags? Plase help me.
« Reply #3 on: January 12, 2019, 11:38:41 AM »
Download Find Closest 2 from Ecosystembrowser ;)