My door is now unable to close and i have no idea why

Was working fine before, i did set the doors default rotation to be open and it closes immediately making me think it has something to do with the code not understanding my if statement for door close, also no idea why GetWorld() is causing the error, i can still compile fine and has been working fine regardless of the error up till now. (If you wanted to help with GetWorld() it has an issue with me using -> telling me to use * instead however changing it to * just moves the red line to GetFirstPlayerController().)

Note i put the backslash on line 32 of the CPP file while taking a screenshot, this is not the problem… Im using a tenkeyless keyboard lol

EDIT: I set the CloseDoorDelay to 3 seconds and adjusted the angle before hitting play, the door did take a moment to close so I’m fairly positive that the error is with the trigger and the door. I have confirmed that in the SM_Door’s components the TriggerVolume is set as the pressure plate.

Any help is greatly appreciated!

The rotation is absolute, if you have the doors rotated in the world then it’s not going to work, Ben solves this later

Even if i don’t rotate the door in the world it doesnt work, rather it stopped working way before i tried to adjust the doors rotation

Could you show what you have in Unreal then?

Sure thing, hope this is what your asking for

Sorry I forgot to add that I was asking for the details of the door mesh.

hopefully this is what you mean, still in the dark with UE4 haha

And that’s with a successful compilation? I notice you have an error on line 32 which you might have just accidentally added when you took a screenshot

Yeah its from when i took a screenshot, i have a tenkeyless keyboard so my printscreen and /(numpad) are on the same key. I can compile successfully, I have no idea how i broke it but i think ill just start the section over. But regaurdless do you know why my GetWorld() is still showing an error on line 28?

Edit: I was planning on starting over from the beginning so i could make flashcards so its no biggie

It’s because you are accessing a member off of UWorld (GetFirstPlayerController). It compiles since it’s included somewhere in the build chain but Intellisense isn’t aware of that and only knows UWorld exists (forward declared) and that it’s a class; not what members it has.

So if you go to the docs for UWorld (or just google it, it should be near the top) and scroll down to the bottom of the page you’ll see the location for the header.

“Classes” and “Public” directories are part of your include paths so you only need the relative path after that. i.e.
For AActor, the docs list the header location to be


So you would only need the part after Classes

#include "GameFramework/Actor.h"

Okay thanks for the run through, I was trying to google for a solution earlier and found that including #include “Engine/World.h” got rid of the other GetWorld() errors but not that one. Thank you so much for the clarification, the error notification really bothers me

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

Privacy & Terms