Download

OnTick workaround?

I have a character that you can change texture in the menu. Then on map load it carries over.

Menu widget>button>set var in game instance…

characterBP>OnLoad>set dynamic material
>OnTick>check var>set texture

works great. I don’t notice a performance hit, but I have several material swaps going. And I don’t mind the event tick in the menu as not a lot is going on.
But it doesn’t need to continue once the game map is loaded, the material can’t change after that.

I tried triggering a custom event from the button. Nope.
I tried placing the texture event in the map bp and triggering on load (cast to characterBP on both)

Any ideas?

edit-
I just threw a 0.2 delay in there and you can see the change on load, but I’ll probably fade in. I guess that puts it to 5 times a second instead of 30-60…

Hi, try to add it to the characters construction script or on begin play

Thanks,

It is on the character now. The begin play sets the dynamic mat.
But while in menu it has to be ontick so it updates (the player is in menu).

But when I load the next map is when I don’t want tick.

It’s probably not a huge deal as the game is fairly simple.

—idea? maybe if I run threw a gate, close the gate after map load? can I even check map is loaded?

haha that worked.

My tick runs through a gate. checks the var when I use the buttons.
then goes through a branch and checks a new var- Is map loaded? boolean
When the map loads it sets the var to true>locks the gate and the tick stops.

Create a function to execute the swap/changes. Then use a branch to see if it needs to be/can be done. On spawn set the bool to false.