Hide mesh after switches camera

Hello everyone! Can somebody help me. In simple words. I have 2 cameras, and 1 mesh .
So I have two buttons when I push them I switch to camera “1” or “2”.

I want to hide this mesh when I go to camera “1” , and when I switch back to camera “2” mesh will be visible .

Thank you in advance!

Hello,
easiest way would be to toggle visibility. Node you’re going to need. Target is the static mesh you want to hide.

314296-setvisibility.png

Thank you ! Now I need to activate this Node only when my camera 1 active. Other time I need to see this mesh. I can not found event for this …

This is the node you need to use. Tick box “New Visibility” to make something appear again, leave unticked to make it disappear. When you fire your event for changing the camera add this node at the end and toggle visibility as required.

DonBusso, how I can create “event for changing the camera” ? I’ve already created event “press button to change camera” But changing and automatically hide… I can not found solution
I just start to learn eu4.

You mean event that triggers the actual camera change? I thought you had this set up when you press 1 or 2. Show me your setup if you can, I might help me better understand what you mean.

You mean how to trigger the actual event to switch camera? I thought you’re doing this with 1 and 2 keys. If you could show me your setup it might help me better understand what you mean.

Please see attched. I have simple menu with buttons (widget). I created simple logic - when i press widget button “TopView” - I go to camera “TopView” And now I realeze how also hide mesh “roof” (like on attached picture ) in the same time when I switch to camera “TopView”.

Is your house an actor or is just a static mesh? If it’s an actor make up from various components (walls/floors/roof etc.) you can simply toggle the visibility of those using the node mentioned earlier. All you need is the reference to the “house” blueprint and you’re good to go. You can get a reference by doing a Line trace when you switch camera and then use the hit result to get the roof and make it invisible and then use the same reference to make it appear again when you switch back to original view.
I did a quick test for this and it works as intended.
If your building is just a static mesh it might be easier to put it in an actor blueprint as I don’t know any other “good” way of doing this.

Let me know if you need help setting this up.

This will work as long as your house is a blueprint actor with all the components inside.

If it’s just a static mesh placed in the world, what you could do is do the same thing but use line trace for objects instead (I think it’s better that way) and set material opacity to make it see through. So you would need a copy of the material on the roof and set it’s opacity to “0” and just swap material on hit instead of toggling visibility.

Edit: Did a quick test with toggling visibility. Works as well. You just get the Hit Component and toggle it’s visibility

No problem, happy to help. Let me know if you run into any problems.

I think t that I roughly understood what it was about. can you send me printscreen of test that you have passed. ?
I can’t figure out which nodes to use. Roof of my house is separate mesh.

Thank you man ! you saved my week !

I will try your logic today . and one more question . I can do it in Level Blueprint ? or in the camera bluprint ? and at the begining you use "eventBeginPlay " note ? and then branch with true and false ? Or Event tick ?

I think the best way would be to do it from the camera actor (blueprint) or whatever actor is the one you move around in the world with. Then just add keyboard event for key 1 and 2 there you go, that’s how I have it set up.