Тёмный

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

Matt Aspland
Подписаться 83 тыс.
Просмотров 20 тыс.
50% 1

Опубликовано:

 

19 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 105   
@bill.i.am1_293
@bill.i.am1_293 Год назад
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 Год назад
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 Год назад
Thanks for pointing this out for others!
@stevenwynn819
@stevenwynn819 3 года назад
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 года назад
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 года назад
@@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
@EspacX
@EspacX 2 года назад
Awesome, exactly what I needed. I also used this basis to make a manual sliding door by inputting the player velocity.
@nextanvil3346
@nextanvil3346 3 года назад
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 года назад
Thank you, yeah it's a great mechanic! Thank you :)
@Zetrominator
@Zetrominator 2 года назад
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 года назад
you saved my day :) TY!
@Euenise
@Euenise 5 месяцев назад
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 5 месяцев назад
@@Euenise Woo! Glad I could help
@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 4 месяца назад
Great tutorial. Worked right away. Thumbs up!
@xgamerunknown6414
@xgamerunknown6414 2 года назад
I was totally wanting this. I'm so glad I subscribed to your channel
@Praetorian-Guard
@Praetorian-Guard 3 года назад
Please more Phasmo UE4 tutorials
@MattAspland
@MattAspland 3 года назад
Sounds good, what else would you like to see?
@Praetorian-Guard
@Praetorian-Guard 3 года назад
@@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 года назад
@@MattAspland i would love to make the same game but with my ideas and thoughts, but I lack the programming skill
@MattAspland
@MattAspland 3 года назад
yeah okay, I'll definitely look into it more and see what I can do! Great suggestions, thank you :)
@Praetorian-Guard
@Praetorian-Guard 3 года назад
@@MattAspland no problem
@The_Fennix
@The_Fennix Год назад
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?
@focalaxisssx5490
@focalaxisssx5490 Год назад
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 Год назад
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 года назад
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
@beamngsamurai8
@beamngsamurai8 3 года назад
OMG thank you so much!
@MattAspland
@MattAspland 3 года назад
No problem! :)
@petervandersteen1418
@petervandersteen1418 Год назад
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 4 месяца назад
I would like to know about this too
@SanneBerkhuizen
@SanneBerkhuizen 3 года назад
Thanks, this is awesome.
@MattAspland
@MattAspland 3 года назад
No problem, thank you! :)
@zebra486
@zebra486 Год назад
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
@pwnonator
@pwnonator 2 года назад
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
@victorblanchard7774
@victorblanchard7774 Год назад
The answer is in the video at 7min17
@VictorBiryukov
@VictorBiryukov 2 года назад
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 4 месяца назад
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.
@theofficialamt6626
@theofficialamt6626 Год назад
Can you make a series on a Phasphobia style game. Can't find anything similar.
@JustZiReacts
@JustZiReacts 3 года назад
Awesome work man❤
@MattAspland
@MattAspland 3 года назад
Thank you so much! :)
@krzysztofbogdanowicz4543
@krzysztofbogdanowicz4543 2 года назад
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 года назад
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.
@frozo851
@frozo851 3 года назад
Dont stop. Keep it up
@MattAspland
@MattAspland 3 года назад
Thank you man! I will do!
@potaterjim
@potaterjim 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 года назад
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'.
@abdullahsohail5395
@abdullahsohail5395 3 года назад
It will really help me
@MattAspland
@MattAspland 3 года назад
Glad to hear it!
@batonplay1615
@batonplay1615 3 года назад
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)
@3terr
@3terr 2 года назад
Going through the code, it read when I press LMB, but it doesn't detect me looking at it?
@rifat.ahammed
@rifat.ahammed 2 года назад
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?
@knightyeditz9044
@knightyeditz9044 7 месяцев назад
4:25 I dont have any vector * vector component, now what?
@Dhdowned
@Dhdowned 3 месяца назад
it's just "multiple" and also "add"
@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?
@Jimmybear06
@Jimmybear06 3 года назад
Is there a way I can add a door sound effect as I gradually open it?
@MattAspland
@MattAspland 3 года назад
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 года назад
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
@dangancopa111
@dangancopa111 2 года назад
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
@abdelhaksaouli8802
@abdelhaksaouli8802 3 года назад
wait what you can call player input event from another blueprint other then player ?
@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 года назад
@@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
@arielshtern4125
@arielshtern4125 2 года назад
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.
@oto3911
@oto3911 6 месяцев назад
anyone know unity tutorial?
@Perkins.Garage
@Perkins.Garage 3 года назад
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?
@stathiszoulakis9599
@stathiszoulakis9599 10 месяцев назад
can you make it so the camera doesnt move when you open the door?
@Cedrusel
@Cedrusel 3 года назад
Hmmm, this just isn't working for me using the first person blueprint.
@TaylorAmbrosioWood
@TaylorAmbrosioWood 3 года назад
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 года назад
@@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?
@mrmensje1
@mrmensje1 3 года назад
damn, all that code for simply adding a rotation limit. Is there really no easier way?
@catninja4950
@catninja4950 2 года назад
How do you add sound to it?
@franccca
@franccca Год назад
does this work in unreal engine 5?
@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 года назад
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).
@nicko_3d_art
@nicko_3d_art Месяц назад
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
@sirjodie1888
@sirjodie1888 3 года назад
my head be spinning
@sirjodie1888
@sirjodie1888 3 года назад
i dont know where i am wrong ;-;
@MattAspland
@MattAspland 3 года назад
Whats going wrong? What results are you getting?
@daredgamingstudios5516
@daredgamingstudios5516 3 года назад
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 года назад
@@MattAspland i am able to open multiple doors now but it also moves every door i interacted with
@daredgamingstudios5516
@daredgamingstudios5516 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 года назад
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 3 месяца назад
Yeah just don't try opening it from the other side lol
@efebarandurmaz8804
@efebarandurmaz8804 3 года назад
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.
@SugoiAdam284
@SugoiAdam284 Год назад
Get better
@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
Далее
Why Solo Developers Should Use Unreal
9:51
Просмотров 380 тыс.
The biggest lie in video games
15:18
Просмотров 1,9 млн
Why Scientists Are Puzzled By This Virus
11:47
Просмотров 2,2 млн