0
Answered

OnPointerClick performance

Bread 1 year ago updated by Lazlo Bonin (Lead Developer) 1 year ago 1

Hi! 

I was looking for general performance tips for Bolt and found this recommendation:

Source: https://support.ludiq.io/communities/5/topics/955-scriptrunbehaviourupdate-performance

So, when using the Find module with the On Button Click like that you're calling it every Update, what I currently have is:

Get Variable
(previously assigned GameObject) > On Pointer Click

I'm curious if the Get Variable is also being called every Update when using those modules due to having a bit of overhead from the PlayerLoop, inside of the BehaviourUpdate exactly, to be honest it's minimal, but you start with one button, then another one and it goes on, trying to squeeze performance as much as I can and Bolt is doing a really good job so far.

Thanks for reading. :)

Bolt Version:
1.4.3f2
Unity Version:
2018.4.0f1 (LTS)
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+1
Answered

Hi Bread,

That is actually a very old topic, now event targets only get fetched On Enable or On Enter State. So the performance is actually the  same because it's always cached. You can't change an event listener target throughout the game unless you deactivate/reactivate the state or component.