Great video thanks! For anyone having issues with the door not opening the right way. Check and make sure that your Scene root is the parent of your "Door frame" and that your door frame is the parent of your door. And one last thing you can do if it's opening towards you instead of away from you is inverting the values on your select float node. So instead of the 90 being on top, make it go on the bottom and make the -90 go on top. I hope this helps !
For anyone having problems with the door rotating too fast check your timeline is set from 0 to 1 rather than 0 to 90. For anyone having issues with the door not opening away from them, use "get right vector" instead of "get forward vector" for the camera.
hey, great tutorial, it was very helpful. but, i've got some issues with door's opening, it's not opening all the time, i mean it opens well, but for closing i have to click several times, is there any place where i have to navigate or something???
Hi! I keep having an issue with the "dot product". It throws me an error "accessed none trying to read property". I believe the Player Ref has no value. Any idea how to solve that?
@@CobbDev I remade that part following your video and still get the same message :( I'm using a ThirdPerson Character. Do you think I have to do anything different (any variable, character camera, etc) for the ThirdPerson to work with your example?
Hey man thank you so much for this vid. Thorough explanation and super fast. I had a question though. Is there a way I can adjust where I have to click when opening the door? I'm in the third person template and currently, I have to face the camera to the side of the door respective to the pivot point, rather than square in front of me. Thank you in advance, I hope to hear back soon.
This is a great tut. I realize this is a very old post and that I may not get an answer. I need to ask this question. If I want the door to open by having the player walk into a trigger box on each side of the door instead of using the left mouse key, How would I do that? I tried simply adding a trigger box but that did not work. Is there a way to make that work?
Use a trigger box, and upon entering the trigger box run the line trace from the character to the door, have it go through all the rest of the code (using the dot product to figure out the rotation and then rotating it)
So say we wanted to use the same action mapping to allow us to open door, pick up item, push a button, etc. How do we go about doing that? With this system all line trace is converted to BP actor and calls the OpenDoor function.
The way to do this would be implement a blueprint interface on your "interactible" actors with a generic "interact" function and and call that function if the interface is implemented on the actor from the line trace instead of casting to a specific actor and calling *some* specific function.
Add a box collision to the door, make it as big as you want for the automatic detection, create the OnOverlap event for the box, from there do the dot product calculation. You can cut out the line trace entirely.
There is a huge problem with your logic. If you open the door, then close it and while its closing move to the other side and open it, the door will snap back to the 0.0 rotation. This implementation is flawed.
You must have missed a step in the implementation. For testing I set the timeline to 10 seconds, and tried to replicate what you wrote, but was not able to. If I do as you say, open the door, then close it and move around it to try to open it while it's moving, it's not snapping at all, it just continues to close. And it shouldn't start to open towards you, as it's supposed to always open away from you. Edit: You probably forgot to actually set the dot product variable. If you don't set it, but just use it as it's being calculated, it'll recalculate all the time while the door is opening or closing.
so i found this really easy to follow. but right now im using HorrorEngine. which has it's own doors sound effects etc.. when i try applying this to that engine it doesnt really work. maybe im casting to the wrong character? do you have any videos about horror engine?
Sweat mandella I've never used horror engine, but maybe try just using the door mesh and making your own actor rather than altering the door actor it comes with. If that is what you're doing and it still doesn't work, the issue is probably the mesh, so make sure it has proper collision.
@@CobbDev no i made it from scratch following your every move, i'm thinking its the casting to character. but i will stick to the default for now. great video though man. appreciate the reply.
Would be appreciated having sections for this or slower video since RU-vid doesn't allow for frame-by-frame rewind/fast forward. Also, having a text version of instructions in Description would be extremely helpful since video has no instructional delays points. Thank you for helping, but seemed too complicated because I had to keep backtracking after blinking.
This is a good Tutorial. But I am facing a problem when I try to use the event tick to check whether the distance is getting calculated or not. (03:44) my distance is not updating and I am getting an error. the door is only opening on one side. (Blueprint Runtime Error: "Accessed None trying to read property PlayerRef") Please help me if you can.
Figured it out. Make sure that wherever your "Cast to character" logic is, the beginning of that code should start with "Event BeginPlay," and not something else.
Hey man would be great if u reply what do i do? I done everything u shown me here but when i satrt the game the door spins really fast and then stops in a fixed position. What do i do?
Hey I was wondering if there is a way to keep everything just add a few things to make it automatic so when you step within the trigger box instead of clicking it just opens. I've tried to use it but add in my own thinking havent gotten it to work yet but I'm sure there is a way. I already got it to work with my double door.
Hazey Legend I would have 1 trigger box big enough to cover both sides of the door. Once you overlap the box, use a line trace and the dot product technique to choose which way the door opens. Once you leave the trigger box, close the door. I might actually make a video on this
@@CobbDev a video would be very helpful plus there is definitely no video showing how to make a automatic door that opens outwards on both sides. I've checked a lot. I understand what you are saying and will try it out
@@CobbDev I am actually making it for the ark dev kit which obviously still runs the same version of unreal and is for the most part exactly the same besides I choose cast to shooter character instead of any of the others so I'm more looking into a way to make it all within the bp class itself and not into the character at all because the clicking method wouldnt be very good for ark. I've been making a huge mod for about 4 months now and the video plus a couple other of your videos have helped a lot that's why I was hoping to kinda have your advice for this and get it worked out.
Are you sure that you're searching for the correct name? If you named it something other than BP_Door you'll have to search for that. Also, make sure you're taking it from Hit Actor and your BP_Door is compiled.
Chris doodle BP_Door is the actor we create in the beginning, it's the blueprint we create that has the door mesh and all the code we make for the door. (When we right click, create blueprint, and choose actor)
At 4:00 when I test this 0 seems to be at a completely different location than where the door is at. I've got everything working apart from this part, the door opens well, just not away from me and only in one direction. I've got over the video multiple times but I can't see where I have gone wrong. Seems the world location of my door is wrong?
Cobb Dev Thanks for the reply, the mesh is in the centre of the BP actor. I’m using the 3rd person character and have replaced everything correctly. I don’t have a 3rdPersonCharacter placed in the map, im using a GameStart to spawn instead, could that cause an issue?
@@HawkinsBrosGaming Ah, I think the issue is that since you're using the third person character and the camera is the start of the line trace, that's what's being tracked as which side the of the door you're on, not your mesh. Does just rotating your camera around change the dot product value?
Cobb Dev I’m not too sure, I am currently at work and I can’t check yet. Once I get home I’ll update you if that’s alright. Again, thanks for actually helping.
Can somebody point me to a beginner tutorial because he moves through this so fast if you don’t know what you’re doing already you don’t have a chance.