- Home /
How to model objects only visible to one player in a radar in a mech simulation game? A Fog of war question.
Hi! My friend and I are making a 2player coop Mech game which simulates real radar but probably with multiplayer in the future. First guy is a pilot playing FPS second guy is an electronic warfare system officer playing with radar and such.
Right now I model the radar with a second camera directly over the mech that looks down on the ground. The radar is a box on the mech that rotates, and renders a long line on the navscreen, and on FixedUpdate sends raycasts and creates (grabs from a pool of created objects) little red boxes that belong to the Radar Layer that is only visible from the secondary players camera.
But I also want enemy AI meches to have radar, but then boxes from the AI mech radar gets visible on the 2players cam as well which they shouldn't. I will get the same problem in multiplayer. A radar should only see returns from it's on echoes (we have a separate system for radar warning receiver). Right now I solved it by having code that if a Mech is AI it simply turns the boxes invisible once created, but this will create buggs with the players radar lock system which will "see" them. And that works in single player but not for multiplayer with multiple player meches, but it feels like a hack. I would like a more general solution that always guarantees that a radar camera only see the boxes it's mech's radar sends out and not from other radars.
Anyone got any idea how you would solve this? I imagine you would have a similar problem with fog of war systems in multiplayer rts, a separate camera that only shows object the player knows about but not other players. But they maybe only spam layers to solve it.... Or any game for that matter like rouge likes that have miniradars in multiplayer.
All help is appreciated!
Your answer
Follow this Question
Related Questions
Camera at high height is clipping terrain so I can see underneath 0 Answers
Minimap blib icon error 1 Answer
Change Player MiniMap Icon 1 Answer
Minimap Camera 2 Answers
Can the Camera be Positioned on the Game Screen through code? 0 Answers