Controlling another actor from VR Pawn

I am trying to get my head around the best way to control the movement of another actor from my VR pawn without ‘changing bodies’. Basically possessing another pawns movement without leaving the VR player pawn.

Basically I want to be able to possess another actor in the level and move it around with the right VR controller, while the left controller still controls the movement of the vr player pawn.

Sort of like having a remote control for an RC car or plane in your right hand while still being able to walk around.

Best method in theory? Thanks

I think doing this on your actor will allow it to receive input events like a possessed pawn.

I don’t think a best in theory exists. It depends on specifics.

Some possibilities include:

  • Making the other pawn(s) inherit from an interface class. When you possess something, your character gets a pointer to it, and calls functions on it through that pointer.
  • Similar to above, but, instead of getting a reference to the actor, just give the other pawn(s) a specific type of component.
  • Giving that pawn an AI that is driven by player-controlled parameters.
  • Having the player not actually control a character… just a spectator-like pawn whose input are pointed at actual pawns.

Main thing is that you’re in control of everything in terms of game logic. This is one of those decisions that you might feel like retaking a couple of times if you paint yourself in a corner, and that’s okay. You’ll eventually meander to something that’s good.

2 Likes