UPhysicsHandleComponent

I restarted my own project based on the first person shooter template for better base code.
However i have run into a problem, On trying to get the physics handle in cpp UPhysicsHandleComponent is not recognised in the auto complete list.
I went back to tutorial 78 in building escape to check i wasnt doing anything daft and i am donig exactly as ben does in the video but its just not there in the cpp.

Any advice would be greatly appreciated.

EDIT :- This has been solved by @Rob by adding #include “Engine.h” to either the file you need the UHandle in or the project file. Thanks Rob.
https://answers.unrealengine.com/questions/401383/unable-to-declare-uphysicshandlecomponent.html1

The reason for this is that the firstperson template uses EngineMininmal.h where as a blank template (Like in building escape) uses Engine.h. I literally changed mine over to Engine.h and it worked fine (Minus my own silly bug)

1 Like

I’ve not looked at Unreal at all yet, so this really is a shot in the dark, but check this out:

https://answers.unrealengine.com/questions/401383/unable-to-declare-uphysicshandlecomponent.html

Any help?

1 Like

Sadly not really.
Including the Engine.h does resolve the compile error but in the H file the UPhysicsHaandleComponent remains white when its supposed to revert to its blue class colour.
It crashes the editor sadly.
Although it is giving new avenues to look down.

Thanks anyway

EDIT :- Crash was caused by me coding whilst tired and put the code in the constructor and not begin play.

1 Like

Sorry I couldn’t help more, not touched Unreal yet so anything else may just be a hinderance! Good luck :slight_smile:

1 Like

It might be a little late but I included “PhysicsEngine/PhysicsHandleComponent.h”.
That solved the problem for me and seems to be not such a big include as Engine.h is.
I am using version 4.16

1 Like

Just found out another thing that might be helpful :smiley:
Including “Engine/Engine.h” includes a PCH rather than the monolithic big Engine.h.
It seems to be faster in terms of compiling times.
So maybe this would be helpful when there’s no other way but including the Engine.h.
In my case I needed to do so to get the code completion when using GetOwner and GetWorld.
Got that information here:

Privacy & Terms