Download

BP to turn on/off a television

Hey, you guys. I´m studying Unreal 4. I have a little doubt. I want to put a television on my scene. However, I want find a way to turn on/off my television using a button on my keybord. I find a way to do the same in a lamp, but I could not find a way to do this on my television. Did you guys have any blueprint which would let me do that with a television?

Thanks in advance

What is “turning off a television”? What is your problem? Are you not getting input on your television blueprint or do you not know how to turn off your Television?

Does your television use a MediaTexture and you need the screen to be black?

Please answer the questions and I can help. I just need to understand your problem :face_with_monocle:

1 Like

Yes, the answer depends on your problem.

  1. Is it the actual input - the pressing of the key? How to get that to affect the television? Then, put an input event in your character or player controller for the key you want. Off of this input event, get all actors of class (television) and then, for each one, turn it off or on.

  2. Is it the turning on or off of the television? Do you want to figure out how to give it the effect of being “on” or “off”? Then, create two materials: one for On (image or color) and one for Off (black). When it turns on, set the material of your mesh to the On material, then set it to Off when it turns off. You could also include a point light and set the intensity when it turns on or off.

NOTE: To optimize #1, you could get all televisions on begin play, then save that as a variable which you loop through when the player presses the input.

Hello, Nacho! I make a little advance in my BluePrint. And my current problem now is that I cannot turn my screen to black. When I turn my tv to off, my screen just freezes the image and that´s all. Thanks in advance.

screenshots that show the BP and the problem in scene, and guys above will be able to help you! :slight_smile: You have to supply more details :slight_smile:

Yes, please send a screenshot of the part that is failing.

Hey you guys. I uploaded a screen from my nodes. Like I said. The television turns on when the character get close and everything, the problem is when I try to turn it off. The screen just freezes and don´t turn back to the black screen.

To where did you upload it? You can upload your image to this forum by pressing this button:

Try enabling “Auto Clear” on your Media Texture asset. This should make it turn black when it’s not playing.

Hope this helps!

My friend! This worked just fine! Thank you and everybody else who helped me. Greetings from Brazil.

1 Like

Glad I could help :smiley:

remember in future always provide as much information as you can when you run into problems, then people will be able to help you faster :slight_smile: