Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Gav (HeyBud) on March 30, 2014, 09:39:02 PM
-
I have a Game Object with a 2D collider. When it receives a touch input, it uses a Find Closest (with tag) to get a hold of the GO in its same world position and saves it as a varGO. Since I know where it is and don't need to "find" it, is there a more efficient way to get a hold of this object? - other than triggers, tried that and it's expensive for how many I need. Some kind of action like Get Game Object at Position (with tag)? That would be super useful since I want to limit Find Actions. Currently, I'm using it several times a second for various purposes. I'm not getting performance issues on my I7 PC with 12gRAM, but i'm worried about the effects it may have on phones. Just planning ahead. If you want me to come back when I actually have issues with phone testing, I will. Thanks for any ideas at all. :D
-
Well, this might be what you need.
Get colliders in range. http://hutonggames.com/playmakerforum/index.php?topic=2304.msg10166#msg10166
or you can set the information before hand and collect it later depending on who sent it.
set event data https://hutonggames.fogbugz.com/default.asp?W531
and get event info. https://hutonggames.fogbugz.com/default.asp?W530
The one on top is great but it also deals with arrays which isn't as crazy as it looks!
-
Really should test to see if it is indeed something you need to change before taking action.
You could use a ScreenToWorldPoint or something similar (im not very familiar with touch device stuff). Basically just raycast to the world point and grab whatever it hits. Very likely this would be cheaper, but its something you just need to test on your target device.
-
Okay, thanks guys, these are good options. I need to test more this week and update this thread when I try them out.