Hi,
I am working on a controller for VR, which is basically a Static Mesh of a HTC Vive remote controller, and a 3D object in front of it. The 3D object is a child actor that can be changed when pressing a button on the controller. So far, it can be a cube or a cheese. The 3D object should move with the motion controller, since it’s a descendant of the motion controller. The whole controller can also be changed when pressing another button, to switch between a sword and a shield for example.
This is the hierarchy I have :
- VR_Pawn
- MotionController
- MotionControllerChildActor
- CustomControllerPawn
- CustomControllerChildActor
* MyActorBluePrint that should move
- CustomControllerChildActor
- CustomControllerPawn
- MotionControllerChildActor
- MotionController
If MyActorBluePrint is spawned using the BeginPlay event, everything works as espected. However if wait a bit (or use another event), it is spawned but it’s somehow not attached to its parent, because it’s not moving. GetChildrenComponents on CustomControllerChildActor returns an empty array while it returns a correct array when it’s at BeginPlay, so I think there is something strange. When I change the whole controller, (or when I change the class of MotionControllerChildActor to an another one), the not moving MyActorBluePrint correctly destroyed all the time.
I simplified my script in order to have just a very simple actor, containing a movable StaticMeshComponent without physics and collisions. I attached a screenshot showing it.
What could be the problem? Do you know another solution to do what I want to do ?