Download

Times 2 token pickup problem

Hi everyone, I’m new to game dev and for my first game I am creating an endless runner for mobile devices. I apologise if this question is posted in the wrong area.

In game I have tokens that can be picked up and later used as as an in game currency. I am trying to set it up so that when the player watches a rewarded video they will receive x2 tokens for 1 go (until player death. So far I have set a “token multiplier” variable in the first person game mode BP. And upon completing watching the video set that to 2, then upon player death I have set this back to 1. I am unable to test the video playback as I do not yet have a developer account for iOS. But from testing that I can do I think the problem is that the variable is not being saved upon restarting the level. At this point I cannot post screen shots as I am just about to start work but if needed I can follow up with some tomorrow.

Thanks for any help!

Aaron

Indeed, you have to save this in the GameInstance or PlayerState.
Related read http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

Thanks Unit23, managed to figure it out I should have posted and mentioned that I’d resolved the issue.