playMaker

Author Topic: Find mutliple Gameobjects  (Read 3143 times)

Budde88

  • Full Member
  • ***
  • Posts: 165
Find mutliple Gameobjects
« on: September 16, 2016, 07:29:24 AM »
Find multiple Gameobjects with Tag,

So when I try to find a Prefab gameobject by tag and change it's properties everything works fine, but as soon as I have two or more created Prefabs on my scene, it will only find one of the prefabs and not all of them.

How do I find all of created Prefabs and reference them all at once?

thanks
« Last Edit: September 16, 2016, 09:30:14 AM by Budde88 »

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: Find mutliple Gameobjects
« Reply #1 on: September 19, 2016, 08:03:56 AM »
Can anyone help me out with this please?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Find mutliple Gameobjects
« Reply #2 on: September 19, 2016, 11:57:21 AM »
Hi,
What you can do is when you create a prefab, store it into an array
or in several arrays based on their tag.
When you used several arrays based on their tag, then the tag can be used for different things if needed.

I believe that Find game objects is quite resource heavy so that would not be a very good idea.

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: Find mutliple Gameobjects
« Reply #3 on: September 19, 2016, 01:49:53 PM »
Hey I will give that a try, hopefully someone could write this action in the future though :)
 
Thanks for the reply

EDIT: Having some issues with arrays, think I ran into a bug with Itween generating scripts onto Prefabs when I store them as Objects... weird. So this route seems like a no go right now.

Can someone tell me how to find multiple Gameobjects by tag, I read that finding gameobjects by tag specifically is not resource heavy, besides I only need to find 4 objects max at one time, not that bad ;)

Maybe someone with coding experience wouldn't mind editing the existing script, I have already tried and failed miserably.

Thanks and all the best
« Last Edit: September 19, 2016, 02:44:59 PM by Budde88 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Find mutliple Gameobjects
« Reply #4 on: September 19, 2016, 08:07:15 PM »
Hi,
That is very strange, but you should not use itween it is outdated and veeryy laggy,
you should get Dotween from the asset store (the free one or the pro)
and you can find the custom actions here or on the Ecosystem

if you stil have issues with arrays let me know.

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: Find mutliple Gameobjects
« Reply #5 on: September 20, 2016, 07:11:54 AM »
Well, it's funny you mention that.
I am aware its outdated, I was updating an existing project of mine and I decided to add Dotween of course. When I make objects move from point to point, (almost like arrows navigating an object around a scene) It works fine with Itween, but when I updated it to Dotween and made the objects move at the exact same speed, I was getting serious inconsistencies. Objects just not triggering at arrows anymore or triggering late, I feel like it's been days now and I am getting nowhere :(

Surely someone out there can help with this

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: Find mutliple Gameobjects
« Reply #6 on: September 22, 2016, 01:23:50 PM »
Can anyone help me out with this please?

I have tried arrays, unfortunately the find Gameobjects does not store the objects into a variable and I cannot find and tween all my objects at once.
I really need a Find Gameobjects action that works like find Gameobject but references all the objects at once.

Many Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Find mutliple Gameobjects
« Reply #7 on: September 22, 2016, 06:51:55 PM »
Hi,
You can not reference all object at once in a variable you can only store multiple object into an array or hastable
Can you show on a video what you have tried so maybe we can help you with the array and also show what you want to do (if posible)

Budde88

  • Full Member
  • ***
  • Posts: 165
Re: Find mutliple Gameobjects
« Reply #8 on: September 23, 2016, 07:10:16 AM »
It's Ok,

Thanks for the help, but I decided to just go in another direction as I am losing too much time  :P

All the best