Hi all,
I’ve created a custom C++ class for collectibles and I would like to give them physics so I can spawn them in large quantities and have them bounce around a bit.
In the constructor, I’ve added a sphere collider and set it to be the root component using this code:
_sphereCollider = CreateDefaultSubobject<USphereComponent>("SPHERE_COLLIDER");
SetRootComponent(_sphereCollider);
However, when creating a Blueprint of this class, I am unable to change anything physics related because the options (simulate physics, assigning weight, gravity etc) that are normally on collider components are not visible (see first screenshot). Because of this, I cannot set the rotation constraints and so on. The only way I have managed to get around this is to hard code it like below, but I would rather not have to resort to this if possible. Adding a regular sphere component to the Blueprint allows me to change its physics settings as normal.
if (_sphereCollider)
{
_sphereCollider->SetSphereRadius(20);
_sphereCollider->SetSimulatePhysics(true);
}
Is there something I am doing wrong here?