Rotate Camera Blueprint with players

I’m making a 1vs1 fighting game with a shared camera. I want to rotate the camera so the viewangle stays on the same side of the players when they rotate around, similar to this game: Let's Play Bushido Blade (PS1) Part 1 - YouTube (gameplay starts at ~3:37).

I’ve tried getting the players rotation and setting the camera actors rotation, but it doesn’t seem to rotate correctly.
Any suggestions would be greatly appreciated!

have a awesome weekend!

you need to get middle location between players, then make CameraLocation - MiddleLocation, normalize result and this will be direction vector. Now you can use one of MakeRot functions. For example MakeRotFromX and rotate camera with this rotator.

Thank you for the answer! I’ll give it a try and report back. My vector math is abit rusty.

Hey does this same method apply if my camera is an component of an actor? I’m getting some really weird results, maybe i’m not calculating the math correctly.

220525-camdirection.png

220526-setcamrot.png

yeah its disabled for sure. In any case is the math on those screencaps correct?

firsst of all make sure that your camera doesn’t uses control rotation

For me it looks ok.

What exact problem you have right now?

I only recommend to Set rotator with Roll = 0

Ok i’ll have to get back to this issue next week because im not at the office anymore. Thanks for the help so far, i’ll post my results next week

Ok, so i’ve managed to get the camera rotating correctly. The only issues is now that when my players surpass a certain rotation, the camera flips to the other side of the players and the players movement is affected by it, as i am using the cameras direction for the players controls. Any idea what could be wrong?

I’m getting each actors rotation, summing them together and dividing that by 2(Similarly to how the center point is calculated in the first picture). The division is clearly causing the camera to flip, but also makes the camera actor rotate correctly otherwise. I’ve tried normalizing the value but it doesn’t seem to help.

-Samuelb

Not sure, but its some kind of lock. Camera uses characters location to calculate rotation, and characters uses camera rotation to calculate their rotation.

thanks for the help, i’ll keep trying.

the Rotation has been solved in this thread Camera flipping on rotation issue - Cinematics & Media - Unreal Engine Forums