setting VR Pawn with moving obect

Hi, I’m trying to attach a VR Pawn to a moving object, I’ve put a Child Actor in the blueprint of my moving obect(a helicopter) and choose the child Actor as VR pawn, but when i start the VR preview, the camera is set wrong, not where I put the child actor respect to the helicopter. I’ve just put it as player possess. how can I solve this?

Hey Vincenzocas,

:helicopter: I totally get your frustration—getting the VR Pawn to behave correctly can be tricky! Let’s get you flying high with that helicopter.

First, ensure that your VR Pawn has the correct camera component set up. Sometimes, the camera might not be aligned properly within the pawn.

  • In your VR Pawn blueprint, make sure the camera component is a child of a scene component (not the root). This gives you more control over its positioning.

  • Place the VR Pawn blueprint inside the helicopter blueprint as a child actor, but make sure it’s properly aligned where you want the player to be seated in the helicopter. :magnet:

  • Ensure your player start position is correct in the level. The VR Pawn should spawn at the location defined in the helicopter blueprint, so double-check the coordinates.

  • In the helicopter blueprint, after spawning the VR Pawn, use a blueprint node to possess the pawn. This can be done in the Event BeginPlay of your helicopter blueprint:

// Blueprint Pseudocode
Spawn Actor (VR_Pawn)
Possess VR_Pawn
  • After possessing the pawn, you might need to adjust the relative location of the camera. In the VR Pawn blueprint, you can adjust the camera’s transform relative to the parent to get it in the right spot.

  • Use print statements or the VR Preview mode to debug and tweak the camera’s position. Sometimes, minor adjustments are necessary.

Here’s a simplified example of what the blueprint nodes might look like:

// In Helicopter Blueprint
Event BeginPlay
{
    Spawn Actor from Class (VR_Pawn, Spawn Transform)
    Set Owner (Spawned VR_Pawn)
    Possess (Spawned VR_Pawn)
}

// In VR Pawn Blueprint
Event BeginPlay
{
    Attach to Component (Parent = Helicopter Mesh, Attach Point = Desired Socket or Bone)
    Set Relative Location and Rotation (Desired Position and Orientation)
}

By following these steps, you should be able to get the VR Pawn properly attached and aligned with your moving helicopter. If you keep having trouble, feel free to share more details or screenshots, and I’d be happy to dive deeper with you.

Good luck, and happy developing! :rocket: