Switching camera make character movement weird

i have a camera actor which work just fine

but when ever the camera switch happen the character control get weird this

this is the character controls


cb642625d5d1d6900ef23fd8d15b1963

help am stuck -_-

No one knows what this means. Please clarify. And explain how the cameras are supposed to work, too.

the movement feel random when i press " w" character go right or left when i presse “D” it goes backward

Sounds like it’s related to the way the cameras are setup and we do not know that. You’d need to explain / show in great detail how things are set up and what your expectations are.

alright give me 5 min

  • at a glance it seems that you switch to a camera that is not a part of the character? Is this correct? Or the other camera is a Child Actor of the character?
  • the original camera is set up for 1st / 3rd / top down / custom view?
  • the other camera us supposed to observe the character from another perspective while the movement controls stay the same or become relative to that other camera?

See if you can address the above, someone may be able to take a more educated guess then.

the other camera us supposed to observe the character from another perspective while the movement controls stay the same yes this is it

how can i change the movement to the new camera and not the character 3rd person camera

vs

change the movement to the new camera and not the character 3rd person camera

See, that’s the problem we’re having here :slight_smile:

Those 2 statements are contradicting. I, for once, still do not know if you want to control the character as it was or take this new perspective into account. I’ll assume it’s the latter and you want the new camera to dictate the direction in a logical manner. So pressing A (left) would move you opposite of the right vector of the new camera.


Lemme see if I got it right:

:red_circle: - regular camera movement 3rd person
:green_circle: - new angle for the external camera

But when we switch to the new angle:

The character is still using the old directions but should be using the direction of the new green camera.

How close am I?

1 Like

100% this is it

dude you are a hero

1 Like

how can i do that?

In short

  • make the external camera a pawn
  • implement the same movement inputs as in the character
  • instead of switching cams, possess the camera pawn, store reference to the char inside
  • use the new pawn’s input to generate vector to control the old character

That’s the first approach I’d try. There are more.

1 Like

In case the above does not work the way you need (or at all), consider getting the Player Controller involved:

  • have the PC apply movement instead of the character:

Here, the function generates a different vector depending on whether there is an external camera or not.

  • the camera updates the PC

  • and the camera switching is done like so:

You may need additional logic to handle entering / leaving but it seems like a good direction to take if you’re planning something a bit more complex than just a single camera. Or are planning to have many characters. Or enjoy the benefit of the character still processing input as they may have their abilities to use, for example.

Good luck!


There’s a neater way of handling it by Getting View Target:

image

From here you can figure out whether the View Target is the character or not. That would require setting no references. An improvement to the above, for sure.