Changing character's follow camera location through blueprints

Hello,

I would like to change the character’s follow camera and/or character boom through the use of blueprints. Specifically, I want to create a blueprint of a box, place it in the world, and when the character actor overlaps it, it changes that characters follow camera and/or character boom locations. This is to get a new view on the character from a third-person perspective.

I could use this method here: https://answers.unrealengine.com/questions/23590/camera-selection-with-user-input.html :
However I do not want it to be a level blueprint because I plan on using this extensively, nor do I want multiple cameras because I still want the camera to focus on and follow my character.

Any help is appreciated.

So I’ve been working on this for some time now, and I’m learning a lot about blueprints through trial and error. Here is my code thus far:

I made a blueprint, which contains a mesh less box shape. When the player character overlaps it much like a trigger, it will get his attached camera component and move it based on the values set on the box. You can adjust the location vector and the interpolation speed on the box. I use this for side scrolling game as the player moves throughout the stage the camera will adjust accordingly to the level and what I want them to see, otherwise the camera cannot be changed.

Some problems that I got stuck on:

  • Because I am using the starter example map, there was already a blueprint for the blue guy called MyCharacter. I created another blueprint in another folder also called MyCharacter which was another character actor that I imported and took control of. When trying to discern between the two, UE4 could not tell the FollowCamera component on my character unless I changed the blueprints name…
  • My blueprints main issue is that if I wish to use it for another character I would have to change the “cast to” from dark knight to the new character name. If someone knows a way to make it just detect the player and get his ‘followcamera’ component that would be great.
  • I know it’s hard to see but the relative location node of the follow camera, unless I have it directly hooked up to the ‘current’ slot on VInterp to node, it wont zoom in or out. I’d like to clean it up a little by using a ‘current’ location node.

Lastly, I’d like it so if the character backtracks through the stage, the camera location would be reversed.

Maybe there is an easier way to do all this… seems like there should be. I’m just new at Unreal :slight_smile:

This video should give you an idea of what I am trying to do…

1 Like

Simple, this can be achieved via “FInterpTo”. Just create a Branch with the conditional you are trying to use to change the camera boom length (ie. collision with box), if True set the Target Arm Length (using the Camera Boom as the Target) to the FInterpTo (Current = Target Arm Length), insert the length of your desired camera boom in Target and change Interp Speed to something like 0.45. Use GetWorldDeltaSeconds for Delta Secs input. If your conditional is False, do the same as above but under Target for FInterpTo, insert your original camera boom length. This will basically reset your camera boom length to the original when your conditional is false.

The example image attached was used for the velocity of my character. When the character’s speed was higher than 300, the camera boom length would get longer according to the velocity.