I’m trying temporary disable physic emulation on random target object. It can be sphere, box, capsule, anything… by class UPrimitiveComponent. So, I’m using SetEmulatePhysics BP. And it need UPrimitiveComponent input.
So, i made custom blueprint function with code:
UPrimitiveComponent* UMyEdGraphNode::GetActorPrimitive(AActor* actor){
//UPrimitiveComponent * comp;
return (UPrimitiveComponent*)actor->GetComponentByClass(TSubclassOf <UPrimitiveComponent>());
}
It is an error, because GetComponentByClass function returns UActorComponent type. How can I convert it? Or may be another way to disable physics temporary without loosing it’s physics state?