Hi folks,
I’m trying to implement a double jump powerup in my 2D platformer game, yet something seems to keep going wrong.
Here’s the design.
First, I built an interface in order to communicate between the character blueprint and the powerup one.
As u could see, there’s a boolean variable judging if it’s available for ur character to doublejump.
For the powerup, I made a PaperSpriteActor to contain the texture of icon and set the boolean to true for 10 secs after overlaying with pawn
Finally, this is how I supposed should be like in the character blueprint. I left a printString to check if the bool var changed after acquiring the powerup but it turned out to failed.
No matter I ate the powerup or not, the character could always only jump once and ‘false’ is keep printed on screen when I do so.
However, the msg ‘DoubleJump powerup acquired’ and ‘…deactivated’ is displayed normally, so I guessed the script in the powerup BP is working…
what’s exactly the problem? I’m really getting confused.