Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UPrimitiveComponent
Description
Returns the distance and closest point to the collision surface. Component must have simple collision to be queried for closest point.
| Name | GetClosestPointOnCollision |
| 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="Collision", Meta=(UnsafeDuringActorConstruction="true"))
float GetClosestPointOnCollision
(
const FVector & Point,
FVector & OutPointOnBody,
FName BoneName
) const
Success if returns > 0.f, if returns 0.f, it is either not convex or inside of the point If returns < 0.f, this primitive does not have collsion
Parameters
| Name | Remarks |
|---|---|
| Point | World 3D vector |
| OutPointOnBody | Point on the surface of collision closest to Point |
| BoneName | If a SkeletalMeshComponent, name of body to set center of mass of. 'None' indicates root body. |