Second door opening off first door trigger

Hello all. So I’ve wrapped up section three and I’m trying to make multiple rooms open that each have a single door that separates each room. Each room has one trigger volume that is supposed to open the door to get out based off the correct items being on the pressure plate, which is decided by the weight.

The Problem: The second door opens when the first door opens. When I place the prop needed to open the second door on the second pressure plate, the second door “opens again” in that the another 90.0 degrees is applied to the door so that it flushes against the wall 180 degrees from start rotation.

Attempted Fixes: In each instance of Open_Door_BP, I have ensured that in the Open Door (inherited) class both doors have the correct Pressure Plate assigned. I have also ensured that the Trigger Mass for each door is the correct mass that corresponds the the correct prop to open the door.

Ideal/Desired Condition: The second door only opens when the correct items are placed on the second pressure plate.

Any suggestions would be greatly appreciated!

Additional Notes: I believe this is mostly to do with both doors using the same blueprint, Openable_Door_BP. I shouldn’t have to make a blueprint for EACH door in a level right? If I had 1000 doors in a level that’s 1000 blueprints just for doors.

Might need to take a look at your project.

I’m working on trying to push everything to my github now.

@DanM Okay I’m sorry this took so long. I was trying to figure out Git Bash because I’m getting a duplication error in Git Gui saying I need to pull before I push the commit. I couldn’t figure it out so I just manually uploaded the files to my github. Here is the repo below:

https://github.com/donnymistro/UnrealSection3

Just to make it easier, I should add that the table and a chair opens the first door, and the glass statue opens the second door (which is acting up).

I suspect your commit history is different so would need to stash, reset and pull then apply the stash.

There’s nothing in this repo other than the .uproject. That file isn’t your project, it just tells Unreal how to load your project. This is the entire contents of it

{
	"FileVersion": 3,
	"EngineAssociation": "4.21",
	"Category": "",
	"Description": "",
	"Modules": [
		{
			"Name": "Section03",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"AdditionalDependencies": [
				"Engine"
			]
		}
	]
}

I feared that would happen. I figured out my Git bash problem and remade the repo for this project. Hopefully this should let you go into the project on your machine. Please let me know if you are able to look at it: https://github.com/donnymistro/UnrealSection3/tree/master

Your map isn’t in there but I tested having two doors and it seems to work fine

That’s very strange because my doors are not behaving like that. As for the map not being in my repo, I’m confused because going by the screen shot below, it’s there.

That being said and playing further with the map, I believe I see the problem. Although the doors are oriented differently, they have the same relative angle once the I hit “Play”. In this case, it does appear that I will need to create another blueprint for the second door. Even if I set the rotation of the second door to some arbitrary rotation angle, it will “snap” back to the same rotation as the first door since it uses the same blueprint.

I fixed it. I made a different blueprint for the second door. It mirrored the same items in the event graph for the blueprint of the first door, but in the timeline I set the key points to (0,-90) and (3,0).

Oh I had that but it was empty, resetting pulled that content now and I see your problem.

That’s an inefficient solution. A better one is to have the timeline go from 0 to 1 which will act as a percentage which you would multiply by the angle you want.

Secondly you can store the initial rotation at BeginPlay to calculate the relative rotation. Alternatively create a scene component for the root component and have the static mesh as a child to that and then use SetActorRelativeRotation.

Secondly you can store the initial rotation at BeginPlay to calculate the relative rotation.

In the C++ code? Wouldn’t that also change the behavior of the first door because both blueprints (or if I used only one blueprint for both doors) uses the same OpenDoor component?

Alternatively create a scene component for the root component and have the static mesh as a child to that and then use SetActorRelativeRotation.

I’m sorry, I don’t know how to do that. I do know that the Primitive Component we used in this section is a child of Scene Component, which in turn is a child of Actor Component. As my code stands right now, the Primitive Component deals with the overlapping of the actors for the trigger volumes that open the doors. The behavior of the doors, specifically the Open Door class, is an Actor Component.

OR maybe I’m overthinking this. Are the suggestions that you are making found in video 103 “Using Variables in Blueprint”?

Okay I fixed it this time (really). I followed everything in video 103 and the door works as expected now, with both doors sharing the same blueprint. The change is on my github. I guess I skipped through that video because I didn’t notice the bug then :crazy_face: I appreciate the help Dan!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms