How To Open A Door With Mouse Drag | Amnesia or Phasmophobia Style - Unreal Engine 4 Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ส.ค. 2024

ความคิดเห็น • 105

  • @bill.i.am1_293
    @bill.i.am1_293 ปีที่แล้ว +23

    for anyone watching this using unreal 5.1.1, in the BP_firstPersonCharacter blueprint, the "mouse input" is now "camera input". This had me confused for a second because it is laid out differently. All you have to do is:
    Under EnhancedInputAction IA_look, promote "action value x" to a variable, then name that variable turn rate. Then, connect the output from "Add controller input yaw" to the input white arrow of "turn rate". Then, connect the white output arrow of "turn rate" to the white arrow input of "add controller input pitch". This will make it work. Make sure all of the other original connections are still as they were and you will be set.

    • @sayhelloethan
      @sayhelloethan ปีที่แล้ว

      should I connect anything to the target or val of "add controller pitch input"

  • @Elitum
    @Elitum ปีที่แล้ว +18

    For everyone having problems with the camera rotating left, but door moving right, change the variable "sensitivity" (which we made during this video) to a negative number (from 6,0 to -6,0). Worked for me!

    • @MattAspland
      @MattAspland  ปีที่แล้ว +3

      Thanks for pointing this out for others!

  • @stevenwynn819
    @stevenwynn819 3 ปีที่แล้ว +16

    Another great video. One suggestion for modifying the blueprint would be to use the nodes "Set Timer by Event" or Set Timer by Function Name" in place of using Event Tick. The timer would only run when the player character is looking at the door (or you could add a trigger volume). That way you could have many doors in a level without worrying about them all executing the branch check with every tick. Just a little more efficient.

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว +3

      Thank you! And yeah you are absolutely correct, that would be more efficient than the event tick. The tick shouldn't be too bad, but yeah if you have a lot of these doors in your level than it might be quite bad on the system. Thanks for letting others know too!

    • @TiNNx
      @TiNNx 3 ปีที่แล้ว +1

      @@MattAspland Hi, could you make a tutorial on opening these doors without the locked camera movement when interacting? Opening doors using this method can cause inversed ways of opening doors,with no camera lock if you moved your mouse to one side fast, the door would slam. I know in Unity there are quite a bit of tutorials on this, but although this method is a great way of opening doors, locking camera movement feels clunky.

    • @deadsamurai2011
      @deadsamurai2011 2 ปีที่แล้ว

      same with a collision box/capsule or circle to enable and disable the input

  • @Zetrominator
    @Zetrominator 2 ปีที่แล้ว +15

    By default the SM_Door asset doesn't appear to have a simple collision box-- maybe just in newer versions. I think this is the main problem people have had in the comments if using that specific mesh, so either swap it out or keep reading below.
    To remedy this, find your asset (not the blueprint) or click the magnifying glass at 1:09 to jump to it. Open it up and at the top (File, Edit, eg.) select Collision, and add [Box simplified collision]. You can go to (Show)->SimpleCollision in your viewport to verify the green box around your door now. Save and close.
    At 5:36 change Draw Debug type from None, to Duration. This will enable the line trace shown in the overview and let you troubleshoot if your trace triggered by LMB is hitting the door or just passing through it. If you were missing a collision box, after completing the tutorial you were likely either unable to interact with the door or just seeing a red line shoot through it.

    • @TuberStevo
      @TuberStevo 2 ปีที่แล้ว +2

      you saved my day :)
      TY!

    • @Euenise
      @Euenise 4 หลายเดือนก่อน +1

      Thank you so much, I have spent a whole hour trying to figure out what the problem was and even uninstalled and installed Unreal

    • @Zetrominator
      @Zetrominator 4 หลายเดือนก่อน +1

      @@Euenise Woo! Glad I could help

  • @nextanvil3346
    @nextanvil3346 3 ปีที่แล้ว +4

    Aw man that is so cool I really like that you can open a door manually instead looking at the animation that is so cool thanks for the video keep it going

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว +1

      Thank you, yeah it's a great mechanic! Thank you :)

  • @EspacX
    @EspacX 2 ปีที่แล้ว +2

    Awesome, exactly what I needed. I also used this basis to make a manual sliding door by inputting the player velocity.

  • @funagengames1177
    @funagengames1177 ปีที่แล้ว

    Thanks Matt! Your Unreal tutorials are the best on youtube and you always seem to have just the right tutorial for whatever I need. I adapted what you taught in this one to using a crank to reset the arm on a trebuchet in my game and it works perfectly!

  • @epetubaa4773
    @epetubaa4773 3 หลายเดือนก่อน

    Great tutorial. Worked right away. Thumbs up!

  • @xgamerunknown6414
    @xgamerunknown6414 2 ปีที่แล้ว

    I was totally wanting this. I'm so glad I subscribed to your channel

  • @The_Fennix
    @The_Fennix ปีที่แล้ว +3

    I am using UE5, but the issue I am having is, the door is turning opposite what I am doing, so if i move my camera LEFT, door goes right, I turn Right Door goes left. Also noticed is their a way to do it When Moving Up Move the door away Like Up = Left, Down = Right? So it would look like you bringing the Door Closer to you and away?

  • @zebra486
    @zebra486 ปีที่แล้ว +2

    idk if this could be answered, but how would this be implemented with the new input mappings system? i have been tinkering with the bp based on this video with the new input mapping and i can't seem to get the yaw working right

  • @focalaxisssx5490
    @focalaxisssx5490 ปีที่แล้ว +2

    The video is very educational, and I've got it working client side, though I was wondering if there was any way to make this run in multiplayer?

    • @ThatsTheMidnightGamer
      @ThatsTheMidnightGamer ปีที่แล้ว +1

      Me too. Whenever these things need network replication it seems like the entire code changes. So when I try and quickly edit the code to be network replicated, its always more complicated than I imagined.

  • @YuBGamerzBen
    @YuBGamerzBen 3 ปีที่แล้ว +4

    This is cool, but the door doesn't really react like you'd expect when opening from one side (moving camera to the right when trying to swing door to the left). Also if you have more than one instance of the door in your world. The first door opened is the only one that opens. The rest just open and close the first door clicked on.

    • @Perkins.Garage
      @Perkins.Garage 3 ปีที่แล้ว

      Have you managed to figure out a workaround? I’m currently struggling with the same issue

    • @Perkins.Garage
      @Perkins.Garage 3 ปีที่แล้ว

      Sorry, to be more specific the the issue where you can’t open any door but the first door in the world

  • @Praetorian-Guard
    @Praetorian-Guard 3 ปีที่แล้ว +5

    Please more Phasmo UE4 tutorials

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว +1

      Sounds good, what else would you like to see?

    • @Praetorian-Guard
      @Praetorian-Guard 3 ปีที่แล้ว +1

      @@MattAspland how to program the whole game 😂 - maybe how to make all this random events like in the game - how to make the tools like flashlight, thermometer etc. - different ghost types - the journal - the shop with the items and if you die losing it etc. everything ... you could make everything in the game to a tutorial

    • @Praetorian-Guard
      @Praetorian-Guard 3 ปีที่แล้ว +1

      @@MattAspland i would love to make the same game but with my ideas and thoughts, but I lack the programming skill

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว +1

      yeah okay, I'll definitely look into it more and see what I can do! Great suggestions, thank you :)

    • @Praetorian-Guard
      @Praetorian-Guard 3 ปีที่แล้ว +1

      @@MattAspland no problem

  • @pwnonator
    @pwnonator 2 ปีที่แล้ว +3

    I would Love an UE5 version of this. Somethings are different and im stuck at "get turn rate" and some things seem to be different

  • @theofficialamt6626
    @theofficialamt6626 ปีที่แล้ว +1

    Can you make a series on a Phasphobia style game. Can't find anything similar.

  • @VictorBiryukov
    @VictorBiryukov 2 ปีที่แล้ว +3

    Awesome video. Thanks. But does anyone know how to make same thing in UE5? I got stuck in a moment when you have to "get turn rate". There is no "get turn rate" in UE5.

    • @InquisitiveTurtleStudios
      @InquisitiveTurtleStudios 3 หลายเดือนก่อน

      Make sure you're grabbing "Get turn rate" from the blue node in the "Cast to (...)" component rather than the white arrow! I also made that mistake at first.

  • @petervandersteen1418
    @petervandersteen1418 ปีที่แล้ว +3

    When I've dragged two of the drag door BP into the map, only the most recently will open even when looking and attempting to open other doors. Do I need to create new BP's with different variables for each door?

    • @pedrorosa5782
      @pedrorosa5782 3 หลายเดือนก่อน

      I would like to know about this too

  • @beamngsamurai8
    @beamngsamurai8 3 ปีที่แล้ว +2

    OMG thank you so much!

  • @SanneBerkhuizen
    @SanneBerkhuizen 3 ปีที่แล้ว +1

    Thanks, this is awesome.

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว

      No problem, thank you! :)

  • @krzysztofbogdanowicz4543
    @krzysztofbogdanowicz4543 2 ปีที่แล้ว +1

    Fantastic tutorial ! One question - how to make classic door which are opened only to one side (can not be rotated around frame) ?

    • @TAMEJoKeR
      @TAMEJoKeR 2 ปีที่แล้ว +2

      I have just done the same thing. It would be the same concept except adding in the minAngle. So having a max open angle and min close angle. I also added a forward vector check so that you can open and close the door with the correct rotation depending on the side you are standing by getting the sign vector of the forward vector of the camera (+1 or -1) to determine which way i was facing and then multiplying that to the output of the make rotator which gave me the desired effect.

  • @JustZiReacts
    @JustZiReacts 3 ปีที่แล้ว

    Awesome work man❤

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว +1

      Thank you so much! :)

  • @potaterjim
    @potaterjim 2 ปีที่แล้ว +3

    I'm having a problem, using the standard first person package, it isn't recognizing the hit to the door. When I get to the branch just before the CasttoDoor, it always returns a false. Even when I turn on the linetrace visibility, I can clearly see that the linetrace is penetrating the door

    • @lpking2005
      @lpking2005 2 ปีที่แล้ว +1

      I had this issue also and found that i had to add a box collision to the door and set the collision preset to 'BlockAllDynamic'.

  • @frozo851
    @frozo851 3 ปีที่แล้ว

    Dont stop. Keep it up

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว

      Thank you man! I will do!

  • @abdullahsohail5395
    @abdullahsohail5395 3 ปีที่แล้ว

    It will really help me

  • @rifat.ahammed
    @rifat.ahammed ปีที่แล้ว +1

    Thanks again, Matt, but I've got an issue. If I rotate the door with a big max open angle , the door mesh enters into the wall , making it feel like there is no collision. And if the main character stands in front of the door and tries to open it , it won't stop. But I want it to collide with colliders and seems natural. How can I do it?

  • @3terr
    @3terr 2 ปีที่แล้ว +1

    Going through the code, it read when I press LMB, but it doesn't detect me looking at it?

  • @batonplay1615
    @batonplay1615 3 ปีที่แล้ว +2

    How to make the sound of opening and closing the door so that the sound is put on pause when you do not open the door and when you continue to open the sound continues from the same place. I want to make the door creak. I'm sorry about my gnarled English. I'm from Russia✌️! You're being watched by an indie studio from another country. Rejoice)

  • @TheLord7even
    @TheLord7even 3 ปีที่แล้ว

    Great work! I came here because I'm looking for a solution to create the valve wheels from amnesia where the player has to move the mouse in a circle to rotate the valves. Do you know how this works and is it possible that you make a tutorial for that? Thanks in advance

  • @wookiebush7449
    @wookiebush7449 3 หลายเดือนก่อน

    This doesnt work, maybe because of a 5.1.1 update. My setup is identical but when I click on the door it immediately jumps to the 100 angle and I can continue to swing it open through the wall until it reaches the -100 angle, then it immediately jumps to the 100 angle again.

  • @cgnovice2969
    @cgnovice2969 2 ปีที่แล้ว

    Fantastic material! One thing though. When i'm on the other side of the door this is flipped and i can't figure out how to sort it out! Any idea?

  • @arielshtern4125
    @arielshtern4125 2 ปีที่แล้ว +6

    It's a good tutorial, thank you!
    But there's one problem, now the other side of the door is flipped. Meaning that the direction of which you move the mouse is opposite to the direction of which the door is moving.

    • @TAMEJoKeR
      @TAMEJoKeR 2 ปีที่แล้ว

      Dont know if you found a resolution to this, but my door works as a normal door would and the way that i did it was get the sign vector of the forward vector (+1 or -1) to determine which way i was facing and then multiplying that to the output of the make rotator which gave me the desired effect.

  • @abdelhaksaouli8802
    @abdelhaksaouli8802 3 ปีที่แล้ว

    wait what you can call player input event from another blueprint other then player ?

  • @oto3911
    @oto3911 5 หลายเดือนก่อน

    anyone know unity tutorial?

  • @Salaudo
    @Salaudo 3 ปีที่แล้ว

    My only issue with this (and I've been struggling for days to figure this out) I just really wish the door would follow the cursor if that makes sense? Rather than it turning dependent on the way you turn the camera. And I would like for it to be more clear on how to limit the door to only opening one direction

    • @Arrkail
      @Arrkail 2 ปีที่แล้ว

      did u manage to solve it?

    • @Salaudo
      @Salaudo 2 ปีที่แล้ว +1

      @@Arrkail sort of, but I'm gonna watch Ryan Laleys new series of interaction videos as it's much more what I'm looking for.

    • @Arrkail
      @Arrkail 2 ปีที่แล้ว

      @@Salaudo i wanna make a lever system which u need to drag using the mouse if u know good resources you can share that would be nice. thanks for the reply

  • @stathiszoulakis9599
    @stathiszoulakis9599 10 หลายเดือนก่อน

    can you make it so the camera doesnt move when you open the door?

  • @franccca
    @franccca ปีที่แล้ว

    does this work in unreal engine 5?

  • @Perkins.Garage
    @Perkins.Garage 3 ปีที่แล้ว +1

    I keep experiencing the weirdest thing, i’ve double checked the blueprint to make sure it is correct yet when the door is opened in the reverse direction it glitches and swings very fast all the way to the max turn angle.

    • @SenEmChannel
      @SenEmChannel 3 ปีที่แล้ว

      me too, i dont know how to fix it

    • @Vegriv
      @Vegriv 2 ปีที่แล้ว

      Make a second sensitivity variable that's negative from the original. Set up a trigger on the side that doesn't work. Make another AddLocalRotation that uses the new sensitivity variable. Example... Sensitivity Side A = 6 ... Sensitivity Side B = -6

    • @Merlon420
      @Merlon420 2 ปีที่แล้ว

      Did you find a solution?

  • @catninja4950
    @catninja4950 2 ปีที่แล้ว

    How do you add sound to it?

  • @knightyeditz9044
    @knightyeditz9044 6 หลายเดือนก่อน +1

    4:25 I dont have any vector * vector component, now what?

    • @Dhdowned
      @Dhdowned 2 หลายเดือนก่อน

      it's just "multiple" and also "add"

  • @dangancopa111
    @dangancopa111 2 ปีที่แล้ว +1

    Literallt please help i followed to tutorial did exactly what you did and when i look at the door and click it does nothing please help ive been trying for 4 hours to try and get this to work

    • @cgnovice2969
      @cgnovice2969 2 ปีที่แล้ว

      The tutorial is 15 minutes, you could just have redone it instead of pulling hairs for 4 hours :D

    • @dangancopa111
      @dangancopa111 2 ปีที่แล้ว

      @@cgnovice2969 back when i was doing this i redid it like 6 times and it ended up being a unique glitch in my program lol

  • @Jimmybear06
    @Jimmybear06 3 ปีที่แล้ว +1

    Is there a way I can add a door sound effect as I gradually open it?

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว +1

      I assume you could maybe get a very short clip of a sound effect and play that every time you update or move the door? I haven't looked into that one too much, but I assume that would work, you've just get to get a sound effect which would sound good with that. Or have a longer one, but only play it when the door (or your mouse) is moving.

    • @stuffedturtle1426
      @stuffedturtle1426 3 ปีที่แล้ว +2

      On the true and false (within the Branch just after the Gate). Add 1 more then node. Then 0 will continue like normal (Into the timeline), the false sequence will have the same set up (false Then 0 will go into the timeline).
      Then within the True sequence, out of Then 1, put a Play Sound at Location. choose the sound, then grab a reference of the door static mesh (Or the handle etc. Whatever you want it to be). Out of the Door reference get a "Get World Location" and plug that vector into the Location of the Play Sound At Location.
      Copy those 3 nodes (Play Sound- Get World and the Door reference), Then paste it and connect it to the Then 1 in the false section of the Branch node.
      For me I put a delay between the Then 1 and the Play Sound at Location so that after 1 second the sound will play (Simulating the door hitting the door frame).
      Hope I made sense- feel free to comment if you are confused or need any more help :D

  • @nicko_3d_art
    @nicko_3d_art 11 วันที่ผ่านมา

    cool tutorial, Im sad tho i did everything and it still didnt work for me. Not sure what i missed, even watched multiple times and the door still wouldnt open
    Edit: After continuously trying i figured it out lol I watched this about50 times to find out what was wrong. Keep trying dont give up

  • @mrmensje1
    @mrmensje1 3 ปีที่แล้ว +1

    damn, all that code for simply adding a rotation limit. Is there really no easier way?

  • @Cedrusel
    @Cedrusel 3 ปีที่แล้ว +1

    Hmmm, this just isn't working for me using the first person blueprint.

    • @TaylorAmbrosioWood
      @TaylorAmbrosioWood 3 ปีที่แล้ว +1

      same. I'm just phasing through the door. However, the same thing is happening when I recreated this using the 3rd person template. Do you think it could be because we are on a newer version of Unreal? Or maybe I missed something. Let me know if you figure it out!

    • @jazer0440
      @jazer0440 3 ปีที่แล้ว +1

      @@TaylorAmbrosioWood Hi, I had the same issue and I think I figured it out... I'm guessing it's actually the mesh that comes with the starter contet that has problems, I simply used a different mesh and it worked perfectly. Hope I could help :)

    • @TaylorAmbrosioWood
      @TaylorAmbrosioWood 3 ปีที่แล้ว

      @@jazer0440 thanks i'll try that!

    • @robogreek9688
      @robogreek9688 3 ปีที่แล้ว

      @@TaylorAmbrosioWood did you find any solution?

  • @iiior605
    @iiior605 3 ปีที่แล้ว

    Bro! Help me please!
    I made the multiplayer game, and I have answer. How I should cast to all characters? U cast to single person, but I have 5 players in game. How should I do. Help please 😿🙏

    • @trx6049
      @trx6049 3 ปีที่แล้ว +1

      I think you can do that by getting the "Get player controller" node then connect it to the "Cast to" Object input, then in "Get player controller" you can specify which controller you want to cast to (ex 0 is player 1, 1 is player 2, etc).

  • @notadhdeveloper4994
    @notadhdeveloper4994 3 ปีที่แล้ว

    Mine is inverted and wonky. When clicking on it the door snaps in the opposite direction and moving the mouse right will make the door move left. I need help.

    • @akshatsood8067
      @akshatsood8067 3 ปีที่แล้ว

      Hi, did you find a solution for this?

    • @notadhdeveloper4994
      @notadhdeveloper4994 3 ปีที่แล้ว

      @@akshatsood8067 I do not remember sorry

  • @sirjodie1888
    @sirjodie1888 3 ปีที่แล้ว

    my head be spinning

    • @sirjodie1888
      @sirjodie1888 3 ปีที่แล้ว +1

      i dont know where i am wrong ;-;

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว

      Whats going wrong? What results are you getting?

  • @daredgamingstudios5516
    @daredgamingstudios5516 3 ปีที่แล้ว +1

    for some reason it only works on 1 door if u try placing more all doors will affect the last added door do you know of a fix for this

    • @MattAspland
      @MattAspland  3 ปีที่แล้ว

      Hi, if you select the action mapping for our interact, or drag mouse, you can un-tick "consume input" in the top right. This should allow you to place multiple doors down and use all of them :)

    • @daredgamingstudios5516
      @daredgamingstudios5516 3 ปีที่แล้ว +1

      @@MattAspland i am able to open multiple doors now but it also moves every door i interacted with

    • @daredgamingstudios5516
      @daredgamingstudios5516 3 ปีที่แล้ว +3

      after the line trace from the hit actor if u place a == self and a branch will solve the issue so then it only sets is looking at to that specific door

    • @daredgamingstudios5516
      @daredgamingstudios5516 3 ปีที่แล้ว +1

      also need to set is looking at to false on release of input action

    • @TheAsenkah
      @TheAsenkah 2 ปีที่แล้ว

      @@daredgamingstudios5516 Thanks for these comments. You are a legend and resolved this for me with a pretty simple solution. :)

  • @DaStuntChannel
    @DaStuntChannel 2 หลายเดือนก่อน

    Yeah just don't try opening it from the other side lol

  • @efebarandurmaz8804
    @efebarandurmaz8804 3 ปีที่แล้ว +2

    I generally like your tutorials and thank you for sharing your experience and knowledge. But this video is terrible, I followed the same instructions and I have multiple bugs and issues that makes no sense and you didn't show or say something about these.