I have experience with Unreal, but I am relatively new to Unreal 4. i have been using Digital Tutors and reading Unreal documentation.
I am working on using the Sidescroller Template in Unreal 4 in order to modify it to a 2.5D fighter similar to Marvel Vs. Capcom 2.
I have learned how to have my camera fixed to the position that I want it by using Blueprint., however how do I make the camera follow the player when I press left or right?
As of right now, it just seems to stay fixed to the position I have it set in and the character just runs out of the player screen.
What I would do is create a boom attached to your Characters Scene Component or Capsule component (Whichever is the root) then attach your camera to the boom.
So in your character’s blueprint, add a spring arm component to the root component. This will be represented by a red line. Then create a camera component as the spring arms child this will attach it to the spring arm. Now edit your camera how you want, and the spring arm component settings control how the camera will follow.
You wont need to create a graph to do this, as its all done in the viewport and using components.
Heres what mine looks like:
This makes the camera always follow the character and stays on him wherever he goes. Now, mine is a hard snap, so its a rigid spring arm and just follows my character with no pizazz. But the default spring arm will automatically adjust its length (Zoom in zoom out) based on if an object obstructs it, and you can set the camera to have a follow effect, or more gradual movement etc.
Thank you for your prompt response, I will do some research on the info you provided and post my results!
The method I posted is for attaching the camera to one specific character. Since you mentioned Marvel Vs Capcom 2, I thought I should add that it will take a bit more than this, as the camera in that game is more of a separate entity that moves based on the two fighters positions. on screen.
This would require a bit more logic than what I have presented. For that purpose, it would require a blueprint graph that updates the camera position on tick.
Youd have to have references to your 2 characters in the camera blueprint, and have the cameras location change based on the location of those characters. How the camera moves etc would be up to you.
Is it possible to expose this camera in the editor so that I am able to look through it? Or is there some way to parent an existing camera in the editor to the camera that was created within the characters blueprint?