I’m currently in the process of making a game, and I’m working on getting the core gameplay mechanics and elements done for play-testing. I’ve come back to working on the health pickup. The problem here is that my game has multiple characters and no two characters have the same amount of health. (EX. Male 1 Health is 100. Male 2 Health is 200.) Once that player walks over the health pickup it should get their health value and increase it by a certain amount. However, I’m having trouble with this. Here’s the setup.
Once I got it to work, I ran a split-screen test and it worked for player one but not for player two. (I know that has to deal with the get player character function I added.
That is the setup. Any help would be graciously accepted. Thanks.
Multiplayer stuff requires well, multiplayer thinking Assuming you do not have the direct cast anymore:
- Your problem is that Get Player Character that is currently set to index 0 (which is the first player)
- You need to have it iterate and loop to see if there are other players indexes at that time.
TBH, I would have just used that “other actor” output from the Overlap Event, that’s the purpose behind it. Then you can set the conditions appropriately.
Hopefully this helps! If so, please upvote and mark as answered. Good luck!
I take it that I’m using a ForLoop correct? If so, it has an exec pin so where would I place?
…if you do not know how to use loops, then you should start with some videos first and then work up to this. Or like I suggested. Use the OtherActor output instead, and let unreal figure it out for you
OtherActor can only do so much. Everyone’s health is not the same. It still has to pull that character’s health (Float variable) and set it accordingly. I know what I want. It’s just the matter of getting there. Lol. I need the health pickup to be able to get any player that walks over it and pull their health variable and add the indicated amount of health to the variable aka their health.
Then do what I’ve suggested…it works just fine for me.
Well do you think you can post a quick sample setup using your method? It’ll be greatly appreciated.
Well I’ve actually figured out a method of my own to accomplish my goal. Thanks for trying to assist me.
Oh? Post your solution for all to benefit.