I am trying to create a set of C++ classes that provide VR functionality. The structure that I am using is that my player Pawn class owns two sub-actors (i.e. classes derived from AActor) for the left and right MotionControllers.
In the BeginPlay() function of my Pawn I have the following:
FActorSpawnParameters SpawnParameters;
SpawnParameters.Owner = this;
LeftController = GetWorld()->SpawnActor<AMotionControllerActor>(FVector::ZeroVector, FRotator::ZeroRotator, SpawnParameters);
On AMotionControllerActor I have the possibility to set a UStaticMeshComponent*, which is used for the visualization of the MotionController ingame. So in AMotionControllerActor I do the following:
UPROPERTY(Category = StaticMeshActor, VisibleAnywhere, BlueprintReadOnly, meta = (ExposeFunctionCategories = "Mesh,Rendering,Physics,Components|StaticMesh", AllowPrivateAccess = "true"))
class UStaticMeshComponent* StaticMeshComponent;
If I would use the MotionControllerActor directly, this allows me to set the mesh from the Details pane of the Unreal Editor. Which is what I want.
However, because I spawn the AMotionControllerActor inside my player Pawn class I can no longer access the MotionControllerActor directly (which makes sense). So I would like to expose the UPROPERTY for the left and right MotionController directly from within my Pawn to the MotionControllerActor. In other words: I want to be able to pass through the UStaticMeshComponent for the Left and Right controller directly from the Details pane associated with the player Pawn to the AMotionControllerActor inside the Pawn.
Maybe this is extremely simple, but somehow I have been unable to come up with a good method to accomplish this.