Howdy! I have this character actor in my level that I want to sit on a bed and not move (its a character actor for legacy reasons - it was initially built like that despite it not needing to be). I wanted the pawn actor to simply stay in place and transform to what ever new location I gave it, so I turned off both simulate physics and Enable Gravity for the capsule component and skeletal mesh component - yet the actor consistently falls through the floor and into space. The only way I stop this is by setting the actor to be static (which I don’t want because I would from time to time want to move the actor under the floor to be hidden)
I checked the Actor in the world and it appears to have all aforementioned things turned off. The Collision capsules of the actors are all variations of overlap, so not blocking colliders. What do I need to do to disable any gravity? Thank you.
These will do what your after.
void UPrimitiveComponent::SetEnableGravity(bool bGravityEnabled);
Two Notes: I quickly opened it up a second time and realized had never looked at the character movement component. Setting gravity to 0 made to it stop falling when I set it to moveable, so hopefully that fully resolves my issue.
Second related to your response gamepainters - currently this is a Blueprint only actor, is there a way to convert it into a C++ quickly to access the above property/method? I presume there’s some way of compiling a c++ file from a blueprint, but if you have to duplicate it and then replaces references then count me out I don’t got time for that. Either way thank you for the quick response.
just use your component mesh to get access to those function.
bool bIsGravityEnabled = GetYourMesh()->IsGravityEnabled();
//if false set it true, if needed.
bIsGravityEnabled = !bIsGravityEnabled;