Announcement

Collapse
No announcement yet.

Change pawn possession but keep the same camera?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Change pawn possession but keep the same camera?

    Hi,
    I'm trying to make my player character to mount a horse, so my first possessed pawn is the character, then I possess the horse with the character attached to it. Both have 3rd person camera setup.
    Everything works fine but the viewport teleport to the horse default camera location and rotation as the active camera switch from the character's camera to the horse's camera and I don't want this, I want to keep viewing from the player camera.
    I've seen on the forum that you have to set the bool "Auto Manage Active Camera Target" in the player controller to False to prevent the controller from automaticaly switch cameras on possess/unpossess.

    When set to false, the game starts on the player controller camera on the ground as it doesn't "possess" the character's camera. OK.
    Now at the beginplay event, I use a "Set View Target With Blend" node with my character as target so the game starts on the character's camera.Ok

    But as soon as I possess the horse, the view switch the player controller camera (on the ground) instead keeping the same camera's view.
    So I really don't understand, isn't ""Auto Manage Active Camera Target" made especialy to avoid this situation !?
    Why does something automaticaly switch my camera target when I disable ""Auto Manage Active Camera Target"?
    How do I keep the same camera?

    #2
    Is your Camera a separate object to the Character and Horse? Or does each have their own Camera Component? Just to clarify, a high level description of what you want is; you have a Character (3rd person?) and you want them to mount a horse, which you then take control over, while keeping the same Camera your character uses. You do not want the camera's to switch from Character to horse?

    Why don't you just use one camera then? Mount your character, lock it's position to the horse, take control over the horse, no camera change required. I've not dealt with this myself, but this is how I'd approach it. Hope it helps.

    Comment


      #3
      The camera+spring arm are components of the characters blueprint, controlled by adding yaw and pitch input to the player controller. Camera of the horse is unecessary and could be removed if everything work as intended.

      How would you use the camera attached to a third actor and why?
      The problem is still the same, the camera will still switch when unpossessing the player character to possess the horse character unless I find why there's an automatic camera switch while "Auto Manage Active Camera Target" is set to false.

      Comment


        #4
        There may be better solutions, and I'm not that experienced with this but here's my idea. You set up an actor, call it something like bpCamAndAnchor. Inside this you set up a scene component, your spring arm and camera, treat the scene component as the place your character would be, implement your yaw/pitch control. Now remove the cameras from your character and horse. Have your new bpCamAndAnchor set it's location (scene component location) to wherever you want your Camera to be. Basically, keep it locked onto your character, this way there's no camera switching, just one camera. This how it appears to work in most games, I can't see any reason why you would want separate camera's unless you want different views. Think GTAV, the character get's into a car, the camera doesn't appear to change, it's just changes what it's locked onto and allows new camera preset's/controls. If you wanted to change Camera view from 3rd to 1st person, then I would imagine a Camera Swap would be wanted, but then smooth transitions aren't a concern.

        Comment


          #5
          The problem is the camera switching is done automaticaly by the engine and as I said, if I deactive it by setting "Auto Manage Active Camera Target" to false and manualy set the target view to one camera (any camera) it still set the target view to the default camera which is in the player controller when possessing a new pawn.
          Adding another camera won't resolve the problem because once I'm possessing a new pawn, the view target is set the player controller camera and that's what i'm trying to stop. If I can stop then I don't need another camera than the one which is in the player character.

          Comment

          Working...
          X