playMaker

Author Topic: Specify Game Object - Peformance?[SOLVED]  (Read 944 times)

kavery

  • Full Member
  • ***
  • Posts: 149
Specify Game Object - Peformance?[SOLVED]
« on: January 17, 2019, 02:02:38 PM »
Kind of a general question. I attached an image of an example action. Is it slower to use direct game object input like this vs using a GO variable?

Just wondering if this method requires a game object search every time the action is used.

Thanks
« Last Edit: January 18, 2019, 01:52:23 AM by jeanfabre »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Specify Game Object - Peformance?
« Reply #1 on: January 18, 2019, 01:50:32 AM »
No, the action stores a reference to the GameObject in either case, so it doesn't need to do a search. Generally, actions that do searches have "Find" in the name. These can be slower but it depends on your specific use. It's generally best to build the simplest behaviour that works, test it, and then optimize if necessary.

We will be adding some profiling tools to the PlayMaker editor soon to make it easier to spot bottlenecks (e.g., highlighting states that are taking too much time).