Which player did it?

Me and @Coofin have been working on a multiplayer game for a little less than a week. But none of us have experience with multiplayer. We have a HP system that works in single player, but if another player gets damaged, the HP bar will be shown damaged to all players.
Can someone fix this?

This happens to me too. If I made a single player game and converted it to multiplayer, I can’t just turn the player object in a multiplayer object. That would make bars shared.

I haven’t found a fix to this but my guess is to make the bars SEPERATE from the player.

if you create an object variable insted of a global(if you did that) then any visual change will occur but only the player that did it should actually die. Let me know if it works

2 Likes

How do I do that though? That is kind of the issue.

1 Like

You make UI and send messages and stuff.

1 Like

But that would reply to all players wouldn’t it?

1 Like

Maybe I do something with this?
image

Make it so the player objects have special numbers like 123213 or 56764335 and then they send the number to the they’re designated health bars filter and the health bar only gets one of the messages or you could make the players spawn the health bars and then you can make the message only get sent to the spawned objects.

1 Like

I love working with multiplayer. Its a fun challenge. Do you have a screenshot of your code?

1 Like

What code do you want?

1 Like

Whatever your healthbar is in.

In the UI object


Player object

1 Like

You need the player check object in your player. The player does not need to count the other player objects that are remote.

2 Likes

You could also make so that each player object spawns in their own health bar so the they could send the message to all spawned objects using the setting in messages and then it should work flawlessly.

Okay, I got that,
image
What do I do now?

1 Like

What do I do?

1 Like

I am unable to take a screenshot right now. You need to make it so that when the player is remote, it turns off the switch that has the collision attached to it.

1 Like

I don’t exactly understand.

I am sorry for the inconvenience. I will be able to give you a screenshot this weekend.

Okay…