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
This video should give you an idea of what I am trying to do…