OnPointerClick performance

Bread 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 1


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:
Unity Version:
2018.4.0f1 (LTS)
Scripting Backend:
.NET Version (API Compatibility Level):

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.