I have created a simple TV that when I press the “E” key, it plays a video. Pressing it again turns off the TV. But now the video just stops after playing and that’s all, i.e. I need to press “E” key 2 times to first turn off the TV and then turn it back on by starting the video again. And how can I make the video after playback AUTOMATICALLY “turn off” the TV, so that I do not have to press “E” twice, and it was enough to press it once again to turn it on and that’s it?
Thanks for your help. But in this case it turns out that yes the TV does turn off after playing a video file, but… There is a FliFlop here, which when pressed again turns off the TV, and it turns out that if the video is running, pressing “E” again turns it off, when playing the video to the end it turns off. But… if you press “E” after that, the TV will try to turn off again, and only after 2(!) presses it will turn on again.
Don’t use FlipFlop then.
- press key → video plays
- press again while the video is playing - what should happen?
If I don’t use FlipFlop, then how can I manually turn it off during video playback if I want to, without waiting for it to end? If I don’t use FlipFlop, then yes, the video will now play to the end and turn off the TV. With the “E” button I start everything again. But I need to be able to turn it off at will during the process.
And another question: I did all the Blueprint in LevelBluprint so I watched the video tutorial. But… for some reason this Blueprint doesn’t work when I try to make it in “standard class (Actor)” Blueprint! I made for example a tape recorder with audio cassettes, there all without any problems. But here video textures and something I’m confused. Because if you do as in the lesson in LevelBluprint, it turns out that I can turn on/off the TV from any end of the map. of course, this is nonsense.
But I need to be able to turn it off at will during the process.
for some reason this Blueprint doesn’t work when I try to make it in “standard class (Actor)” Blueprint!
Generally speaking base actors should not process input => it’s disabled by default. You can enable it but it will make things really difficult for you to handle. Instead, have a look at any interaction tutorial:
https://www.youtube.com/results?search_query=ue+interaction+tutorial
The objects should not be pressing buttons, neither should this be implemented in the Level Blueprint. Input belongs to the player - either the the Player Controller
or the Pawn
.
The player presses a button → send an interact
message to the actor. The actor can interpret it any way it wants. So you can press E:
- if you’re looking at the door, it opens
- if you’re looking at the bucket, you kick it
- if you’re looking at the TV, it plays a video
All with the same button.
it turns out that I can turn on/off the TV from any end of the map. of course, this is nonsense.
That’s what tracing and overlaps are for. Do have a look at the tuts, this is handled there, too.
Thank you so much! It’s all sorted out! TV works as it should. As for Blueprint not working in the Actor Class, it’s purely my fault…I plugged the Character Controller in the wrong place and overlooked it. Yes, I’m an idiot:)