Class Projectile
has a mesh representation:
// Visible mesh
UPROPERTY(EditAnywhere, Category = "Components", meta = (AllowPrivateAccess = "true"))
TObjectPtr<UStaticMeshComponent> Mesh;
The static mesh can then be set in the blueprint class using the details pane of the Mesh
component:
To reduce what is loaded when Projectile
is referenced, TSoftObjectPtr
can be used instead of TObjectPtr
. However, the static mesh can then not be set in the blueprint. The whole details panel for the Mesh
component is blank.
What is the correct way to use TSoftObjectPtr
so that the mesh can be assigned:
- in the editor before gameplay
- dynamically during gameplay using C++?