Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UPrimitiveComponent
Description
Set the center of mass of a single body. This will offset the physx-calculated center of mass. Note that in the case where multiple bodies are attached together, the center of mass will be set for the entire group.
| Name | SetCenterOfMass |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/PrimitiveComponent.h |
| Include Path | #include "Components/PrimitiveComponent.h" |
| Source | /Engine/Source/Runtime/Engine/Private/PrimitiveComponentPhysics.cpp |
UFUNCTION (BlueprintCallable, Category="Physics", Meta=(UnsafeDuringActorConstruction="true"))
void SetCenterOfMass
(
FVector CenterOfMassOffset,
FName BoneName
)
Parameters
| Name | Remarks |
|---|---|
| CenterOfMassOffset | User specified offset for the center of mass of this object, from the calculated location. |
| BoneName | If a SkeletalMeshComponent, name of body to set center of mass of. 'None' indicates root body. |