Two players every one can't see other screen,How?

Hello, I tried to create a game for two players but not on the same screen, I mean player 1 has a screen with squares that must be hidden for the other, And the same for player 2. Look at the next picture.

I put in my land some objects, I don,t want (he) to see them, because he will guess where they are, and I have his land as empty to guess his objects are where?

How can I do that?

I’m afraid I don’t understand. Do both players have a section on the game window that is their ‘board’? Is it multiplayer, between two different devices? Do you want to know how to hide the objects on the right board? What exactly are you asking?

Yes, on Both devices, Both players have their board, I will try to make it multiplayer, I want player 1 to have player 2 board but empty, on my turn in the game I click a square in his empty board on my screen, If this square has a diamond in his board I destroy it, And this diamond appears in this empty board on my screen, If my guess was wrong X sign appears in this square that I clicked, It must appear, So I don’t click him again.

I guess you would need to give an ID variable to each instance in the scene, and then display them or not depending on the player ID.

Sorry, How can I do that?

I wish somebody helps me.

I wish I could but I really don’t know what or how.

I think he means give a variable to the objects at the beginning of scene. So I think you’d have to put them all in an ObjectGroup in your editor. So what variable to give them because it has to be unique, so that part trips me up. I would try to give them an id of the players name I guess, and later while doing the code I would find an easier solution (you always find better ways to do it as you’re working on it). Anyway at first you can try having the player input their name, changing the text of a scene variable to that input, hiding all items of ObjectGroup at the beginning of scene, then doing a condition like “change the text of ObjectGroup variable PlayerName set to scene variable PlayerName” and then say if ObjectGroup variable PlayerName = Scene variable PlayerName show ObjectGroup.

I’m not saying that would work because I always have to try stuff first to see if it does work. Also I advise you if there is a part of your game you’re stuck on and you don’t know how to do it and aren’t getting help, go work on a different part of your game for now. Just let all those objects be visible to everyone and work on other logic in your game. As a game dev you can’t panic or give up or waste a lot of time just because you don’t know how to do something yet. You just put it a TODO comment in and go about your business developing the rest of your game (or a completely different and easier game if you don’t know how to do anything in the game you “want to make” yet haha) and believe me you will soon either figure out the solution yourself or run into your solution in some completely weird and random way.

1 Like

Well, we can’t give any specific guidance if we don’t even know how you handle your multiplayer.
If you’re using P2P, there’s the expression P2P::GetID(). If you set an instance variable to that value, I assume you’ll be able to hide or show the instance, depending on the P2P current player ID. :person_shrugging:

1 Like