Increase score gradually whilst holding an item in 2D platformer game
I am developing a 2D platformer game in Unreal at the moment and I'm somewhat lost. What I have until now is 2 players that are able to move around the platforms and a camera that follows them (also pans in & out).
I would like to add an item to the game, let's say a ball that when a player collides with he 'picks it up'. Now, I won't have no animation for that or anything complicated - the player might as well just have a red outline whilst 'holding the item'. I want the score to progressively increase by, say 10 points each second while the player 'holds' the item. If the second player collides with the first player (that is currently in possession of the item), the second player 'steals' it and his score will increase by 10 pts a second instead - until the first player takes it back, and so on.
2D Platformer with 2 players. Player 1 picks an item (collides with) and he gains score constantly. Player 2 collides with player 1, he 'steals' item and gains score points for himself, again, continuously - 2 SCORE BARS. And so on.
I do know how to script, say, a player picking up coins and increasing his score with each coin collected, but not this. Any sort of help would be greatly appreciated. Thanks!
basically it's the exact same as picking a coin.
Though except of giving him "coin value" right away, you Set a Timer.
If you need to grant 10 points on hit, you just call "GrantPoints" right before you Set the Timer ;)
answered Dec 21 '18 at 07:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here