Hide SceneComponent from specific camera

Hi,

I’m relatively new to UE4 and have been struggling with the following problem:

I’m trying to implement a Minimap for an RTS-style game. I have chosen the approach of using a SceneCapture2D which captures the map from above, so changes to the terrain will automatically be captured. However, I would like to have the Actors be shown as solid-color rectangles instead of their actual meshes. The idea I had for that, was to attach a rectangle mesh with a solid-color texture on top of each actor, somewhat like a hat. The SceneCapture2D would then only see the rectangles above each actor and render these (into the HUD).

Now where things get tricky, is that I obviously don’t want to see all these rectangles above each actor’s heads as a Player. I saw the functions “Hide Component” and “Hide Actor Components” for a SceneCapture, but sadly there doesn’t seem to be an equivalent function for a camera. All answers on here, which asked similar questions, seem to have been resolved by using the “Set Hidden in Game” function, which won’t cut it for my use, since I only want to hide the mesh from a single camera (or rather all instances of a Camera-Blueprint).

I also tried using “Only Owner See”, but I couldn’t figure out how to set the SceneCapture2D as the owner of the rectangle-mesh (also I don’t think this would work in a multiplayer scenario, where each Player has his own SceneCapture2D for their own minimap).

Does anyone know a way to hide a SceneComponent from (one or more) specific cameras? Or if anyone has a better suggestion on how to go about implementing my minimap, I’d be happy as well.

Thanks in advance, Elewyth.

Edit: Added a screen shot of the actor components (left), how the actors currently look in-game (center) and how the minimap looks (right).

27087-actorcomponents.png

27088-actoringame.png

27085-minimap.png

I would be interested in a solution for that as well.

Hey, were you able to accomplish this? I’m quite interested as well!

What you could do is get references to the player actors in your camera blueprint, then spawn the rectangles according to this references and attach them to their respective players. This way, the camera blueprint owns them since it spawned them. So the OnlyOwnerCanSee node should do the trick.

Thank you for the tip! It took me a while to get it working but I could finally do it! :wink:

Glad I could help :smiley: !!

Can you share the trick with us as I’m confused by the issue, I would like to show an icon on the game map that doesn’t show on any other cameras, like your triangles, now Scene Capture 2d can do this but how can it be done with all the other cameras in the game set at least the player camera!