Download

Camera for a dual fighting game

Hi, I need some suggestion. A camera for a duel fighting like street fighter, in fact actually like the UFC game. Where stays camera in the middle of two characters and also rotate with the characters, as the character not only moves forward and backward but also left and right. Any suggestion will be very appreciated.

I think it sounds like a good idea. I would suggest that you do this camera system, I think it would go very well with your game idea, although I am not quite so keen on the rotate with the characters idea. It could become a little too much if it is done too often.

Not sure what sort of “suggestions” you’re looking for, but here is a thread about the same thing from a little while ago: Having trouble setting up a 3D fighting game camera. (similar to Fight Night and UFC.) - Blueprint Visual Scripting - Unreal Engine Forums

In fact any one can suggest the basics, or suggest the logic of this type of camera movement which can help to understand.

Attach a camera to a point which sits inbetween the 2 players and do a trace towards both players and zoom in and out so that they are always kept in frame. For the rotation you just want to keep your middle object rotating in the same direction between the 2 players and rotate it and your spring arm will automatically move the camera

Hi, ZoltanJr. Thank you for the reply. Can you give a little more hints about tracing towards both player and the zooming. As, I am a newbie, I really appreciate your help.

The below will get your camera to stay right in the middle of the players always. I just use an object in the middle with a spring arm and a camera on the end. The zooming takes a bit more work which I might do a blueprint for if I get time but you want to trace the edges of the camera view. So if its 90 degrees which is a normal perspective then you will trace 45 degrees on each side and if a player hits that trace then zoom out until they n longer hit it. Then you can have a delay to zoom back in. Set a min and max zoom which will just be changing the length of the spring arm.
65c41b7c7daa6424d2eae036e863edc9e06d708a.png

Thank you very much for this. But I have question. What node should be used for camera rotation/orientation with the fighters when they will rotate?

Nope thats not doing anything with rotation at the moment but all you will want to do is rotate the base of where the springarm is attached. There is a lot of examples of getting the rotation between 2 objects on here and youtube so just apple the same thing to setting the actor location just with rotation. You will probably want to bump up the camera lag too.

Thanks ZoltanJr. This will help a lot. I will try that way.

Hi, here is the clip for the fighting camera.
[video]https://dl.dropboxusercontent.com/u/83160309/CapturedMovie003_converted.avi[/video]
[video]CapturedMovie004 converted - YouTube

Now the problem is when the player jumps over the camera also rotate as the camera rotation is based on fighter/character rotation. How can I fix this?
And problem is the zooming. How maintain the distance from 2 fighters to keep them both on screen?
Any idea?

Split the rotation struct out and just attach the pins that you need for rotation and leave the others blank. For the zooming you will need to find the edge of the camera view and check if the player is hitting that, can just put some trigger volumes with a really long range on there or place a block at 45% angle from the camera and move it a few thousand units away and see if the trace gets interrupted by the character then just adjust the spring arm length