All I’ve found is how you setup variables for the constraint between two objects but nothing about the first step of initializing the actual constraint itself.
So… What do I need in the header and how do I initialize it in my constuctor?
All I’ve found is how you setup variables for the constraint between two objects but nothing about the first step of initializing the actual constraint itself.
So… What do I need in the header and how do I initialize it in my constuctor?
Hello,
You should be able to declare your Physics Constraint component like this in your .h:
UPhysicsConstraintComponent* PhysicsConst;
After doing this, go into your .cpp, and include the following:
#include "Runtime/Engine/Classes/PhysicsEngine/PhysicsConstraintComponent.h"
Finally, in your constructor:
PhysicsConst = CreateDefaultSubobject<UPhysicsConstraintComponent>(TEXT("Physics Constraint"));
This process worked perfectly on my end. Let me know if you have any further questions regarding this, or run into any issues.
One final note, ensure in your project’s .h file that you have included Engine.h, not EngineMinimal.h.
Have a great day
Thank you very much! In my defense I tried doing this but was obviously not thorough enough and was missing that beautiful include.
Again thank you very much!