Hi, I’m working on a game where the main character can transform upon picking up powerups. The powerup only lasts for few seconds and the character transforms back to its original form.
Here’s the problem: The timer doesn’t always work. There are times when I’d get a powerup and never go back to the original form. What’s worse is that the editor doesn’t count it as an error so there are no errors/warnings that popup after I test the game.
The characters look like these for now. The one on the far left is the main character, the other two are the transformations.
This game is basically like Temple Run: You run away from the monster chasing you. So what’s happening in my blueprint is that everytime the player transforms, the old character gets hidden then a new one spawns, after few seconds the player reverts back to its original form.
Well the problem was the Boss_BP (enemy in this game) destroys even the hidden actor causing the set timer to not call its blueprint. So what I did was that after I hid the main character, I moved it to the side so the enemy wouldn’t kill it.
Power Overlap > Cast to MainCharacter > Set Actor Hidden > UnPossess > Spawn NewActor > Possess > AddWorldOffset > Set Timer by Event > Add Score > Destroy PowerUp Actor