I just started working with UE5, and this tutorial has been so informative. Direct and concise: I cannot tell you how much I appreciate that. Thank you!
I'm building a game for my semester project and we have used so many of your tutorials. This video was exactly something that we needed! We're totally going to cite you in our credits
For anyone having a problem with the camera switching to the middle of the character (or somewhere else) after the door opens: 1. Open Door BP 2. Go to the Set View Target with Blend node 3. Disconnect the Target from the Player on Open Door Custom Event 4. right click > add Get player character 5. Connect the Return Value to Target Not sure what changes or why. But I ran into this problem and it took a few minutes to solve but it works now.
I can't believe the timing with your tutorials. Currently working on an assignment where I've worked on this problem for the last 3 days :D Got burnt out and decided to go for a dinner break, came back and saw this. You sir are my UE Bible
Thank you so much again, this is so incredibly useful and very clearly explained. I hope the Unreal Engine people will recognize you for your work for Unreal community; you deserve some sort of grant!
Thank you for the tutorial! I've completely skipped on the camera part, since I want my doors to be right next to the buttons and I also made them automatically close. If anyone is wondering how to make 'em close automatically it's pretty simple. In the DOORBP1 I went from the OPEN DOOR T (timeline that goes into Lerp and Set Relative Location) there I went from FINISHED into DELAY (set any amount you want) and the DELAY went BACK to OPEN DOOR T (reverse) Sadly I'm really really new into this, so I don't know what to call anything by it's name. So hopefully it makes sense.
Such a brilliant tutorial, and a new way of doing interactions (to me). I was struggling to do the bit with the camera earlier this year. Definitely going to be using this. Thanks Matt!
Sir ty and appreciate tf out of you, was trying to make this work for so long and you fixed all my problems in 16 minutes AND it's a nice clean code that i can use for multiple interactions. Godsent this channel really.
Good video, thanks. If you don't break out of the loop, it will allow one button to trigger multiple events, which could be useful (not with the camera thing though, of course). EDIT: Why not just have a "IDevice" interface for the door, and have the button keep an IDevice variable, that can be picked in the scene. That way there's no need for loops, it's as simple as device→invoke.
Always great tutorials, Matt. Anyway I've tried to add a closing action that gets fired if the door is open. I used a boolean variable that gets set as the opening/closing action is completed, but the only result I had has been the door not opening at all anymore. I'll check your other tutorials to get a solution, of course, but adding that option to this one would be awesome as well. Cheers!
This is great, thanks! Any suggestions for the most efficient way to set this up so one button can control multiple doors? They all still share the same value integer, but after hitting the switch, you could animate each door one by door. Watch door1 animate on its camera, then watch door2, etc until all are complete. I think I can see how to do it, but I might not end up with the most elegant solution.
Hey man, to link all the doors to one button you would give them the same value yep. Or to have them go off one after another, you could link the button to one door. Then off of "finished" of the timeline, where we switch the camera back to the player, you could interact with and open the next door. So on and so forth until you open them all, and then you can go back to the player. Hope that makes sense :)
@@MattAspland I worked on modifying the system to allow for one to open and close a singular door and managed to reverse it easily but I have also tried working on multiple doors opening at once but for some reason it only reads one door registered to a button value at a time and althought this might just be down to an issue with the modifications made to the code i cannot say for certain where the issue lies
Thank you very much to you and people like you who share their expertise with all these poor naives like me. Just a question, I want to cast a sound once I open the door but with this method the sound of the opening door will be re-casted no matter what because it is just a loop. Any suggestion?? Maybe to link the sound to the door itself and check with the vector? Idk, coding can drive you mad... T_T EDIT: i managed to use once and connect "play sound at location", so the next time you try to open it, it will just show you that the door is already open but won't emit any sound at all. [I even put at the end the disable/enable input (with delay) so that you cannot move the character when the code is executing.]
great video the door works perfectly - I just need help with something Let say you have a HUD for your game and when you go to open the door it switches camera you want the HUD to go away then when the door is fully open and it switches back to the player you want the HUD comes back. Is this possible, if is can you show in a video how to do it.
I had some issues during the creation of the button to connect the "For each Loop" to "Door Value". My mistake was that I did not follow exactly the same order as in the tutorial to create the "Get All Actors" and "For each Loop" (I defined the Actor class after I linked "For each Loop", but you need to do it BEFORE!). Just follow the exact same order as in the tutorial and everything will be fine. Hope it can save someone the hassle I had!
can't connect the "Open Door-Player node to the "Event_Intercat- Player" node (11:32) Any idea why? Please help, I've been going crazy over making this door opening thing
Thank you so much. This is very heplful. But I made some mistakes because the camera view didn't work for me. My camera view switched to center to the character. Do you please help me with this issue?
Hey thanks for this one, I have a question - how can I make it so it only does this once and from then on just works as a normal button (not changing cam)?
I got this working but my values seems bugged, Still a very good tutorial. When I copy the button and door and change values of the door and button. The other door is opening as well
I seem to solve the door and button value thing issue mentioned in the comments by adding the default value 1 to them and from there up to 2, 3 etc....
Can you combine this with the collect items tutorial I wanna make like a Lego game system where you collect the items and then a new part of the level opens
Does anyone know how does one add a component in the new blueprint UE5, there isn't any add button there, like 2:30, there an ADD but there is nothing similar to this, bellow we have component but with just the root blueprint
As fantastic a tutorial this is, how on earth would I implement this code with a door that require 3 buttons to be pressed down in order to open? It would be a great addition!
Hey, I did something similar to this in a horror game im working on but i connected the button and the door in the same blueprint. The problem I have is that I set the button to the keybind "e" but if i put any other instance of this door in my map the keybind doesnt work on one button door but it works on the other. Do you have any clue if there is some way i can change it so the keybind works for every button door i place?
If i set the values differently with just 1 door/button. Like for example, if value of door is 3 and button is 4. it wont work. If the values match, it works. But soon as i do it with 2 buttons and 2 doors. even with the values matching for each one. it don't work. button A. with a value of 3. Will open button B. with a value of 4. lol and then the other buttons just wont work at all.
@@pseudonym108 I'm honestly still strugging with it, can't seem to make any of these mechanics work modularly like I want.. i gotta duplicate/change bp stuff around anytime i need a different one.. there has to be a better way.. i just have not found it yet!
It works well with the one just created but if I try to duplicate them or create child and change values the new door with button don't work ?? I'm really confused about that, any possible reason ?
Thanks great tutorial. So I added multiple doors and buttons and set Door and Button values to match but no luck. Door 0 was fine but others nothing. So I disconnected the break off of the For Loop and it worked perfectly. I went ahead and replaced the For with Break with just a plain For Loop. Is that bad? Is that loop running endlessly? I don't understand what the Break is for.
@@Arrkail Well it worked when I deselected the break wire so that "fixed it" but I still don't know why it wasn't working when I had it wired up like Matt shows.
This is great! Thank you! Any chance you could do a video on how to interpolate player movement based on health? For example, I have a slowly deteriorating hunger bar in my game and I'd like the player to smoothly slow down the lower their hunger bar gets: Hunger = 100% therefore player movement should be 300 Hunger = 75% therefore player movement should be 275 Hunger = 50% therefore player movement should be 250 Hunger = 0% therefore player movement should be 200
So I used this and it works fine but when I place another button, one or the other will work but not both. Any idea what I could be doing wrong? I did make sure the button value and the value of my object matched, the second button just does not interact, but if I remove the first button it does interact.
It seems I'm not the only one having a problem with the integers. The 1st switch/door will work fine but, as soon as I put more than one door in things get weird. My switch 1 will open door 2 and door 1 is no longer recognized in the code. This is where it gets very odd for me; Occasionally if I go back in to test play a 2nd time none of the switches will not work at all. I've been trying to solve the issue on my own but I've combed through a thousand times now. Any help or idea why this might be happening would be appreciated. Using UE5.2.1 and I swear I've followed this tutorial before and had zero issues.
I just use this recently but try using a flip flop before the timeline and then use the B route plugged into reverse at end part of the timeline might work
Hey Matt can you please help me out I want to make a wave system but with different types of enemys if you have done this can you please link it me thanks :)
I'm probably missing something because I followed everything to the tee and it did not work, I used my own meshes I have on for the door and another module for the button, I have no idea why it doesn't want to work
I had the same problem. In the blueprint viewport when you first add the camera and the door drag the camera to default scene route and click attach. This way the camera and cube have separate routes so only the cube moves. Hope this helps.
Is anyone else having the same problem where when they move one of the doors it affects the other doors position, even if they arent linked? If anyone could help would be much appreciated
How do I change the colour of the object instead of moving the object. In this instance I am making an object (RED) and it changes colour to GREEN when interacting with the button and the camera pans to the colour change. Can anyone help me out please?
If you want your button to open more than one door, be sure not to drag back to the break after finding a matching door. This one bit me in the behind...
Won't it be better to use Tags instead of integer values? You can change the logic from "Get All Actors of Class" with a for loop check to a simple ""Get All Actors of Class with Tag", along with that you can have multiple Tags on a gate that can be triggered by multiple buttons.
for the button-for each loop with break the array elements only appear as actors not as Door BP, even though Door BP is set, hate this crappy hell piece of shit software, its fucking the worst
ue5 unfortunately at 11:15 creating the Open Door function from the 'For Each Loop with Break's' Array Element isn't an option for me. I have "Open Door Timeline" options, but not simply "Open Door" ... kinda stuck now if anyone's got suggestions TIA edit (literally a couple hours later) I messed up while creating the initial node in the door actor and named it improperly so the Array Element couldn't call something it didn't see. derp. rubber ducky to the rescue
I just started working with UE5, and this tutorial has been so informative. Direct and concise: I cannot tell you how much I appreciate that. Thank you!
I can’t say it enough, you’re a beast dude, don’t stop making content it’s so helpful
Thank you so much man! Happy to help! :)
I'm building a game for my semester project and we have used so many of your tutorials. This video was exactly something that we needed! We're totally going to cite you in our credits
For anyone having a problem with the camera switching to the middle of the character (or somewhere else) after the door opens:
1. Open Door BP
2. Go to the Set View Target with Blend node
3. Disconnect the Target from the Player on Open Door Custom Event
4. right click > add Get player character
5. Connect the Return Value to Target
Not sure what changes or why. But I ran into this problem and it took a few minutes to solve but it works now.
thank you bro you're a boss
I had the same issue. But what it worked for me is that i plugged the Get Player Character in PLAYER of the Call Event Open Door
I can't believe the timing with your tutorials.
Currently working on an assignment where I've worked on this problem for the last 3 days :D
Got burnt out and decided to go for a dinner break, came back and saw this. You sir are my UE Bible
Oh wow, that's perfect! So happy I could help you bro!
Best of luck with your assignment! :)
Damn son. I love how straight to the point your videos are. Thumbs Up!
Thank you so much again, this is so incredibly useful and very clearly explained. I hope the Unreal Engine people will recognize you for your work for Unreal community; you deserve some sort of grant!
i followed this without understanding half of the things i was doing. the object i was trying to make worked the first time. excellent tutorial.
Thank you for the tutorial!
I've completely skipped on the camera part, since I want my doors to be right next to the buttons and I also made them automatically close.
If anyone is wondering how to make 'em close automatically it's pretty simple.
In the DOORBP1 I went from the OPEN DOOR T (timeline that goes into Lerp and Set Relative Location) there I went from FINISHED into DELAY (set any amount you want) and the DELAY went BACK to OPEN DOOR T (reverse)
Sadly I'm really really new into this, so I don't know what to call anything by it's name. So hopefully it makes sense.
THANK YOU THANK YOU THANK YOU I HAVE BEEN STUCK DOING THIS FOR 6 HOURS AND YOUR TUTORIAL SAVED MEEEEEE THANK YOU SO MUCH
Thank you for actually explaining what you are doing
Such a brilliant tutorial, and a new way of doing interactions (to me). I was struggling to do the bit with the camera earlier this year. Definitely going to be using this. Thanks Matt!
Thanks so much worked Perfectly
Still helpful in 2024, Thank you :)
Quite instructive tutorial. Many nodes I did not know ^_^
Works well with UE 5.4. Thank you.
Sir ty and appreciate tf out of you, was trying to make this work for so long and you fixed all my problems in 16 minutes AND it's a nice clean code that i can use for multiple interactions. Godsent this channel really.
It was really helpful. Thank you.
Thank you very much for your tutorial, I learned very useful professional knowledge
Amazing tutorial. Currently using this to make a functional elevator 🔥
Good video, thanks.
If you don't break out of the loop, it will allow one button to trigger multiple events, which could be useful (not with the camera thing though, of course).
EDIT: Why not just have a "IDevice" interface for the door, and have the button keep an IDevice variable, that can be picked in the scene.
That way there's no need for loops, it's as simple as device→invoke.
Always great tutorials, Matt. Anyway I've tried to add a closing action that gets fired if the door is open. I used a boolean variable that gets set as the opening/closing action is completed, but the only result I had has been the door not opening at all anymore. I'll check your other tutorials to get a solution, of course, but adding that option to this one would be awesome as well.
Cheers!
Thank you so much! I needed this info and motivation!
Always a pleasure, keep up the great work! :)
Such a good tutorial, keep it up Matt!
Thanks a bunch! U helped me to make my first game
That's great to hear! Happy to help! :)
Thank you so much this helped alot with my first ever game.
youre a GODSENT! Thank you so much!
Old vid, but thanks for a door and keypress button that finally works :D Using it in my current project "Tycate"
This is great, thanks! Any suggestions for the most efficient way to set this up so one button can control multiple doors? They all still share the same value integer, but after hitting the switch, you could animate each door one by door. Watch door1 animate on its camera, then watch door2, etc until all are complete. I think I can see how to do it, but I might not end up with the most elegant solution.
Hey man, to link all the doors to one button you would give them the same value yep.
Or to have them go off one after another, you could link the button to one door. Then off of "finished" of the timeline, where we switch the camera back to the player, you could interact with and open the next door.
So on and so forth until you open them all, and then you can go back to the player.
Hope that makes sense :)
@@MattAspland I worked on modifying the system to allow for one to open and close a singular door and managed to reverse it easily but I have also tried working on multiple doors opening at once but for some reason it only reads one door registered to a button value at a time and althought this might just be down to an issue with the modifications made to the code i cannot say for certain where the issue lies
Great video! Is it possible to make the door close with the same button?
Thank you very much to you and people like you who share their expertise with all these poor naives like me.
Just a question, I want to cast a sound once I open the door but with this method the sound of the opening door will be re-casted no matter what because it is just a loop. Any suggestion?? Maybe to link the sound to the door itself and check with the vector? Idk, coding can drive you mad... T_T
EDIT: i managed to use once and connect "play sound at location", so the next time you try to open it, it will just show you that the door is already open but won't emit any sound at all.
[I even put at the end the disable/enable input (with delay) so that you cannot move the character when the code is executing.]
Thank you very much!
I'm going to have to try this out later
Awesome man!
great video the door works perfectly - I just need help with something
Let say you have a HUD for your game and when you go to open the door it switches camera you want the HUD to go away then when the door is fully open and it switches back to the player you want the HUD comes back. Is this possible, if is can you show in a video how to do it.
I had some issues during the creation of the button to connect the "For each Loop" to "Door Value". My mistake was that I did not follow exactly the same order as in the tutorial to create the "Get All Actors" and "For each Loop" (I defined the Actor class after I linked "For each Loop", but you need to do it BEFORE!). Just follow the exact same order as in the tutorial and everything will be fine. Hope it can save someone the hassle I had!
After Matt saved me, YOU saved me as well. Thanks!
I've been looking for this problem for half an hour and it drives me mad before I saw your note. Thank you for saving my life!
It works in first person games?
Awesome work, question tho, any way to temporarily disable character movement while the door opening cutscene plays?
can't connect the "Open Door-Player node to the "Event_Intercat- Player" node (11:32) Any idea why? Please help, I've been going crazy over making this door opening thing
Cool! THX!
Merci pour ta vidéo
I love it.
Can you make a tutorial were you need more than one button to open a door?
Thank you so much. This is very heplful. But I made some mistakes because the camera view didn't work for me. My camera view switched to center to the character. Do you please help me with this issue?
Hey thanks for this one, I have a question - how can I make it so it only does this once and from then on just works as a normal button (not changing cam)?
I can't find the "Interact Interface" 9:43 I use UE 5
Did you manage to solve this problem?
Did you not hear him say you need to create it you need to right click go down to blueprints and click blueprint interface
Nice video! But how can we add (Press E for example to interact)?
I got this working but my values seems bugged, Still a very good tutorial.
When I copy the button and door and change values of the door and button. The other door is opening as well
I seem to solve the door and button value thing issue mentioned in the comments by adding the default value 1 to them and from there up to 2, 3 etc....
Can you combine this with the collect items tutorial I wanna make like a Lego game system where you collect the items and then a new part of the level opens
verry nice
Does anyone know how does one add a component in the new blueprint UE5, there isn't any add button there, like 2:30, there an ADD but there is nothing similar to this, bellow we have component but with just the root blueprint
Just discovered ya through a friend i have on Twitch. Just wondering for someone who has gotten into UE5 will these tutorials mostly work as well. :)
As fantastic a tutorial this is, how on earth would I implement this code with a door that require 3 buttons to be pressed down in order to open? It would be a great addition!
Hey, I did something similar to this in a horror game im working on but i connected the button and the door in the same blueprint. The problem I have is that I set the button to the keybind "e" but if i put any other instance of this door in my map the keybind doesnt work on one button door but it works on the other. Do you have any clue if there is some way i can change it so the keybind works for every button door i place?
seems to only work with 1 door.. wont do it if i got 2 buttons/2 doors. only 1 will work?
If i set the values differently with just 1 door/button. Like for example, if value of door is 3 and button is 4. it wont work. If the values match, it works. But soon as i do it with 2 buttons and 2 doors. even with the values matching for each one. it don't work. button A. with a value of 3. Will open button B. with a value of 4. lol and then the other buttons just wont work at all.
Same problem here. Did you end up figuring it out?
@@pseudonym108 I'm honestly still strugging with it, can't seem to make any of these mechanics work modularly like I want.. i gotta duplicate/change bp stuff around anytime i need a different one.. there has to be a better way.. i just have not found it yet!
I have dont all of that but the camara scene not appear, do you know what happened?
hey can you help me how to stop float subtraction when 0 i dont want it to count under 0 btw you are awesome
It works well with the one just created but if I try to duplicate them or create child and change values the new door with button don't work ?? I'm really confused about that, any possible reason ?
did you ever fix this? lol im having the same issue right now
Thanks great tutorial. So I added multiple doors and buttons and set Door and Button values to match but no luck. Door 0 was fine but others nothing. So I disconnected the break off of the For Loop and it worked perfectly. I went ahead and replaced the For with Break with just a plain For Loop. Is that bad? Is that loop running endlessly? I don't understand what the Break is for.
did you manage to fix it?
@@Arrkail Well it worked when I deselected the break wire so that "fixed it" but I still don't know why it wasn't working when I had it wired up like Matt shows.
This is great! Thank you! Any chance you could do a video on how to interpolate player movement based on health?
For example, I have a slowly deteriorating hunger bar in my game and I'd like the player to smoothly slow down the lower their hunger bar gets:
Hunger = 100% therefore player movement should be 300
Hunger = 75% therefore player movement should be 275
Hunger = 50% therefore player movement should be 250
Hunger = 0% therefore player movement should be 200
Great idea, I can look into that! :)
So I used this and it works fine but when I place another button, one or the other will work but not both. Any idea what I could be doing wrong? I did make sure the button value and the value of my object matched, the second button just does not interact, but if I remove the first button it does interact.
my camera follows the door down ? how do i lock camera in place so it doesnt go down with the door?
thanks
What if I needed to use 2 cameras to also show the door closing after the player gets in (I can't figure it out.)
Is it done in first person mode?
it won't let me get the door value variable :c
Same /:
It seems I'm not the only one having a problem with the integers. The 1st switch/door will work fine but, as soon as I put more than one door in things get weird. My switch 1 will open door 2 and door 1 is no longer recognized in the code. This is where it gets very odd for me; Occasionally if I go back in to test play a 2nd time none of the switches will not work at all. I've been trying to solve the issue on my own but I've combed through a thousand times now. Any help or idea why this might be happening would be appreciated. Using UE5.2.1 and I swear I've followed this tutorial before and had zero issues.
Does this work with anything other than a door, eg. a ladder falling down after you press a button and it falls down from a ceiling/attic?
You probably wont see this but is there a way for the button to close the door after opened?
I just use this recently but try using a flip flop before the timeline and then use the B route plugged into reverse at end part of the timeline might work
how would i do this with 2 buttons
I have an error wit the code and if you can help that would mean alot to me it is some infinite looping bug
Olá, e para fechar no mesmo botão como faço????
Hello, and to close the same button how do I????
спасибо большое!
I want to make a rotating door, but the camera stay still... how do I do that?
Hey Matt can you please help me out I want to make a wave system but with different types of enemys if you have done this can you please link it me thanks :)
Hey man, this video might help you out a bit :)
th-cam.com/video/gP2ozW0dLZ0/w-d-xo.html
@@MattAspland thank you so much man! You're the GOAT
Hey can you make a tutorial Where the Player have to follow the ai ?
I'm probably missing something because I followed everything to the tee and it did not work, I used my own meshes I have on for the door and another module for the button, I have no idea why it doesn't want to work
god damn it man. I just wanna press E by the phone and have a level instance load/open. why is this shit so complicated and scarce?
For me the camera follows the door while its going down. How can I make the camera stay in place?
I had the same problem. In the blueprint viewport when you first add the camera and the door drag the camera to default scene route and click attach. This way the camera and cube have separate routes so only the cube moves. Hope this helps.
Maybe you added the camera as child of door mesh in the heirarchy within the blueprint, instead of the root.
I always say "Open it straight away" when I create a new BP. You broke me.
Is anyone else having the same problem where when they move one of the doors it affects the other doors position, even if they arent linked? If anyone could help would be much appreciated
How do I change the colour of the object instead of moving the object. In this instance I am making an object (RED) and it changes colour to GREEN when interacting with the button and the camera pans to the colour change. Can anyone help me out please?
My camera moves with my door
Sry i can’t help but this is too funny bc I feel thes bugs 😂😂 don’t give up I hope you find your solution 👌🏻
If you want your button to open more than one door, be sure not to drag back to the break after finding a matching door. This one bit me in the behind...
Won't it be better to use Tags instead of integer values? You can change the logic from "Get All Actors of Class" with a for loop check to a simple ""Get All Actors of Class with Tag", along with that you can have multiple Tags on a gate that can be triggered by multiple buttons.
I don't see yellow on the left like you - interact
but why so complicated?
there are easier ways
for the button-for each loop with break the array elements only appear as actors not as Door BP, even though Door BP is set, hate this crappy hell piece of shit software, its fucking the worst
dude pace youself :)
ue5 unfortunately at 11:15 creating the Open Door function from the 'For Each Loop with Break's' Array Element isn't an option for me. I have "Open Door Timeline" options, but not simply "Open Door" ... kinda stuck now if anyone's got suggestions TIA
edit (literally a couple hours later) I messed up while creating the initial node in the door actor and named it improperly so the Array Element couldn't call something it didn't see. derp. rubber ducky to the rescue
Why the button interaction works everywhere?