Hmmm. You shouldn’t use the event tick for this because then its doing this check every frame. You should instead do this check when your count amount variable changes, much cheaper. (If this is to become a multiplayer game you’ll want to do this via rep notify)
On to your question:
- I’m not sure where this code is occurring. But im assuming it’s the actor you want to change the mesh of.
- there are some questions about what you’re trying to achieve specifically: for my own sanity im going to imagine you have an empty glass and each time you tap it, the count amount goes up and the the glass fills incrementally.
- In this case, you what to be executing the code from the character (or player controller, probably better) you want to cast to the ‘glassBP’ and you want to set the Target to the specific ‘glassBP’ then just ++ (add 1) to the count amount variable in that ‘glassBP’… you see, so it depends on how you interact with the GlassBP, you could also do a line trace but that’s up to you
The difference is, instead of executing the code in the object, you are executing it on your character and casting to a specific instance of your object and adjusting its variable.