Button And Door System | Open A Door Somewhere Else In The Level - Unreal Engine Tutorial

Sdílet
Vložit
  • čas přidán 29. 06. 2024
  • Hey guys, in today's video, I'm going to be showing you how to set up a system in which you can open a door with a button in the level. This door is going to also be shown opening with another camera in the level. This is very easy to change and build upon. For example, no camera, something other then a door, etc.
    #Ue4 #UnrealEngine4 #Ue4Tutorial
    ___________________________________________________________________________
    00:00 - Intro
    00:30 - Overview
    01:16 - Creating The Blueprint Interface
    02:15 - Creating The Door
    08:17 - Creating The Button
    12:21 - Interacting With The Button
    14:50 - Linking The Door And Button
    15:24 - Final Overview
    15:41 - Outro
    ___________________________________________________________________________
    My Public Video List: trello.com/b/7vJgXzBm
    My Patreon Page: / mattaspland
    Unreal Engine 4 Tutorials Playlist: • Unreal Engine 4 Tutorials
    The Basics Of Nodes Playlist: • The Basics Of Nodes In...
    Blender Tutorials Playlist: • Blender Tutorials
    ___________________________________________________________________________
    If you enjoy make sure to subscribe: / @mattaspland
    Join My Discord Server: / discord
    Follow Me On Instagram: / matt_aspland_
    All My Social Media Links: linktr.ee/MattAspland
    ___________________________________________________________________________
    If you want to support me, you can PayPal me at "matt.aspland.1@gmail.com". This is by no means expected or required. It is just a nice support :)
    My Patreon Page: / mattaspland
    Link to PayPal: www.paypal.com/
    You can also support me on Ko-Fi following this link: ko-fi.com/mattaspland
    Thank you :)
    ___________________________________________________________________________
    ♫Music By♫
    ●Kronicle - Chill Noons
    ●Soundcloud - / the-chemist-10

Komentáře • 109

  • @mjesensky2760
    @mjesensky2760 Před 2 lety +5

    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!

  • @DoomsDay117x
    @DoomsDay117x Před 2 lety +7

    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

  • @AlbertonBeastmaster
    @AlbertonBeastmaster Před 2 lety +3

    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!

  • @EthynLee
    @EthynLee Před 2 lety +21

    I can’t say it enough, you’re a beast dude, don’t stop making content it’s so helpful

    • @MattAspland
      @MattAspland  Před 2 lety +2

      Thank you so much man! Happy to help! :)

  • @thomasknief9721
    @thomasknief9721 Před 3 měsíci

    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!

  • @gamlehundene3762
    @gamlehundene3762 Před 9 měsíci

    Damn son. I love how straight to the point your videos are. Thumbs Up!

  • @silverblank1139
    @silverblank1139 Před 2 lety +1

    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.

  • @TFx2TV
    @TFx2TV Před 2 lety

    Such a good tutorial, keep it up Matt!

  • @arendvandermerwe3309
    @arendvandermerwe3309 Před rokem

    Thank you for actually explaining what you are doing

  • @katiekaliber
    @katiekaliber Před rokem

    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.

  • @oscar_vrdev
    @oscar_vrdev Před 2 lety

    THANK YOU THANK YOU THANK YOU I HAVE BEEN STUCK DOING THIS FOR 6 HOURS AND YOUR TUTORIAL SAVED MEEEEEE THANK YOU SO MUCH

  • @Goyr
    @Goyr Před 2 lety +2

    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

    • @MattAspland
      @MattAspland  Před 2 lety +3

      Oh wow, that's perfect! So happy I could help you bro!
      Best of luck with your assignment! :)

  • @sangheilizealot5787
    @sangheilizealot5787 Před 5 měsíci +1

    Thanks so much worked Perfectly

  • @pewpews2146
    @pewpews2146 Před měsícem +1

    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.

  • @davidedemurodominijanni9889

    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!

  • @kogayokai
    @kogayokai Před 2 lety +1

    Thank you so much! I needed this info and motivation!

    • @MattAspland
      @MattAspland  Před 2 lety +1

      Always a pleasure, keep up the great work! :)

  • @MinecraftSioer
    @MinecraftSioer Před rokem +1

    Thank you very much for your tutorial, I learned very useful professional knowledge

  • @Caca-je4lu
    @Caca-je4lu Před 7 měsíci

    youre a GODSENT! Thank you so much!

  • @oppio1981
    @oppio1981 Před 3 měsíci

    Cool! THX!

  • @ORANOID
    @ORANOID Před 2 lety

    Thank you very much!

  • @penpen7152
    @penpen7152 Před rokem

    Thank you so much this helped alot with my first ever game.

  • @Asmund648
    @Asmund648 Před 2 lety

    Old vid, but thanks for a door and keypress button that finally works :D Using it in my current project "Tycate"

  • @happy-oni9240
    @happy-oni9240 Před 2 lety

    I love it.

  • @thepeki1714
    @thepeki1714 Před 2 lety +1

    Thanks a bunch! U helped me to make my first game

    • @MattAspland
      @MattAspland  Před 2 lety

      That's great to hear! Happy to help! :)

  • @MaxIzrin
    @MaxIzrin Před 2 lety +3

    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.

  • @themouseinthehouse8484

    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.]

  • @MartKart8
    @MartKart8 Před 2 lety

    I'm going to have to try this out later

  • @MaxStudioCG2023
    @MaxStudioCG2023 Před rokem

    verry nice

  • @JenkTank64
    @JenkTank64 Před 2 lety +1

    Awesome work, question tho, any way to temporarily disable character movement while the door opening cutscene plays?

  • @sidewayz6513
    @sidewayz6513 Před 2 lety

    thanks

  • @el_kentavr
    @el_kentavr Před rokem

    спасибо большое!

  • @CreativeSteve69
    @CreativeSteve69 Před 2 lety

    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. :)

  • @glukegames7298
    @glukegames7298 Před rokem +1

    Great video! Is it possible to make the door close with the same button?

  • @texmurph
    @texmurph Před 2 lety +1

    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.

    • @MattAspland
      @MattAspland  Před 2 lety +2

      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 :)

    • @dominicturner15
      @dominicturner15 Před rokem

      @@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

  • @marcogesualdo4970
    @marcogesualdo4970 Před 2 lety

    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.

  • @roryobrien6655
    @roryobrien6655 Před 9 měsíci

    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)?

  • @lonewolf_studio
    @lonewolf_studio Před 2 lety

    Nice video! But how can we add (Press E for example to interact)?

  • @ianasium
    @ianasium Před 2 lety +1

    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?

  • @johnstark5209
    @johnstark5209 Před 2 lety

    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?

  • @luigitasso1894
    @luigitasso1894 Před 2 lety +2

    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

  • @raconte-moiunehistoire756
    @raconte-moiunehistoire756 Před 10 měsíci +3

    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!

    • @tp21_ch
      @tp21_ch Před 5 měsíci +1

      After Matt saved me, YOU saved me as well. Thanks!

  • @vera6587
    @vera6587 Před 2 lety

    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!

  • @CommanderColson
    @CommanderColson Před 2 lety

    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

  • @Ausyaustingaming
    @Ausyaustingaming Před rokem

    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

  • @HGTV_SB
    @HGTV_SB Před 2 lety +1

    Can you make a tutorial were you need more than one button to open a door?

  • @CrionicFear
    @CrionicFear Před 2 lety

    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?

  • @C1ayz
    @C1ayz Před 2 lety

    hey can you help me how to stop float subtraction when 0 i dont want it to count under 0 btw you are awesome

  • @seanposkea
    @seanposkea Před 2 lety

    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
      @Arrkail Před 2 lety

      did you manage to fix it?

    • @seanposkea
      @seanposkea Před 2 lety

      @@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.

  • @otakugamer8957
    @otakugamer8957 Před rokem

    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.)

  • @austinanderson8815
    @austinanderson8815 Před 9 měsíci

    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.

  • @vizthex
    @vizthex Před 2 lety +3

    it won't let me get the door value variable :c

  • @kvmisfit6759
    @kvmisfit6759 Před rokem +1

    my camera follows the door down ? how do i lock camera in place so it doesnt go down with the door?

  • @ulyses9664
    @ulyses9664 Před rokem

    Is it done in first person mode?

  • @pseudonym108
    @pseudonym108 Před 11 měsíci

    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.

  • @VeeIsDead
    @VeeIsDead Před 2 měsíci +1

    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?

  • @DanyEZ
    @DanyEZ Před rokem +4

    I can't find the "Interact Interface" 9:43 I use UE 5

    • @djsalis
      @djsalis Před rokem

      Did you manage to solve this problem?

    • @RTXRealTechReviews
      @RTXRealTechReviews Před rokem

      Did you not hear him say you need to create it you need to right click go down to blueprints and click blueprint interface

  • @alexleveldesign
    @alexleveldesign Před rokem +1

    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 ?

    • @LegendOfCalvas
      @LegendOfCalvas Před rokem +1

      did you ever fix this? lol im having the same issue right now

  • @pseudonym108
    @pseudonym108 Před rokem

    I always say "Open it straight away" when I create a new BP. You broke me.

  • @Bookofwords
    @Bookofwords Před 2 lety

    I want to make a rotating door, but the camera stay still... how do I do that?

  • @jmverso
    @jmverso Před rokem

    Olá, e para fechar no mesmo botão como faço????
    Hello, and to close the same button how do I????

  • @ElMutanga
    @ElMutanga Před 2 lety

    Hey can you make a tutorial Where the Player have to follow the ai ?

  • @Sworn973
    @Sworn973 Před 5 měsíci

    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

  • @UltraCole
    @UltraCole Před 4 měsíci

    how would i do this with 2 buttons

  • @jameshughdalton
    @jameshughdalton Před rokem

    You probably wont see this but is there a way for the button to close the door after opened?

    • @dominicturner15
      @dominicturner15 Před rokem +1

      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

  • @LegendOfCalvas
    @LegendOfCalvas Před rokem +2

    seems to only work with 1 door.. wont do it if i got 2 buttons/2 doors. only 1 will work?

    • @LegendOfCalvas
      @LegendOfCalvas Před rokem

      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
      @pseudonym108 Před 11 měsíci

      Same problem here. Did you end up figuring it out?

    • @LegendOfCalvas
      @LegendOfCalvas Před 11 měsíci

      @@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!

  • @RolandoPeralta3DGraphics

    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

  • @mikemachulski
    @mikemachulski Před rokem

    Why the button interaction works everywhere?

  • @EliteSoldier76
    @EliteSoldier76 Před rokem

    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?

  • @wawa_enjoyer
    @wawa_enjoyer Před 2 lety +1

    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 :)

    • @MattAspland
      @MattAspland  Před 2 lety

      Hey man, this video might help you out a bit :)
      czcams.com/video/gP2ozW0dLZ0/video.html

    • @wawa_enjoyer
      @wawa_enjoyer Před 2 lety +1

      @@MattAspland thank you so much man! You're the GOAT

  • @Ap3xMixx
    @Ap3xMixx Před rokem

    For me the camera follows the door while its going down. How can I make the camera stay in place?

    • @calebrule5009
      @calebrule5009 Před rokem

      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.

    • @dreambadger
      @dreambadger Před rokem

      Maybe you added the camera as child of door mesh in the heirarchy within the blueprint, instead of the root.

  • @EverGameStudios
    @EverGameStudios Před rokem

    Not sure why, but my cam don't return to the right spot. after activation and on cam return the player cam is now inside the body

    • @discordwonderland1707
      @discordwonderland1707 Před rokem

      I have the same problem. Not sure how to fix it.

    • @LegendOfCalvas
      @LegendOfCalvas Před rokem

      @@discordwonderland1707 same here

    • @LegendOfCalvas
      @LegendOfCalvas Před rokem

      I fixed this by plugging into a "get player character" node into the target of the view target blend on the door event graph

    • @erictulio
      @erictulio Před 4 měsíci +1

      @@LegendOfCalvas Thanks so much, i was struggling with this issue lol

    • @LegendOfCalvas
      @LegendOfCalvas Před 4 měsíci

      @@erictulio Glad i could help xD

  • @quizplz
    @quizplz Před 2 lety

    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...

  • @FedosGames
    @FedosGames Před 2 lety

    I don't see yellow on the left like you - interact

  • @brycejohansen7114
    @brycejohansen7114 Před 4 měsíci

    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.

  • @HeplingHandGaming
    @HeplingHandGaming Před 5 měsíci +1

    My camera moves with my door

    • @TheEspada420
      @TheEspada420 Před 26 dny

      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 👌🏻

  • @Xtreme711
    @Xtreme711 Před 2 měsíci

    but why so complicated?
    there are easier ways

  • @ImmaculateRecovery
    @ImmaculateRecovery Před rokem

    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

  • @spellwhisperrr
    @spellwhisperrr Před 2 lety +1

    dude pace youself :)

  • @KeyDesignsDir
    @KeyDesignsDir Před 8 měsíci

    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