I am experimenting with an Antman type character with shrinking and enlarging effects. When I shrink down, my camera remains in its original position. I would like the camera to maintain its relative distance to my character, so that it “shrinks down” in scale with my character, so that the view of the character remains the same, but the world looks much larger.
Thanks
Is your camera on a Spring Arm? As long as you have a variable somewhere that handles the camera distance (such as on a spring arm component), simply apply the same scaling you applied to the character to the camera distance variable at the same time.
This is a total basic example, but let us say there are two sizes, Regular and Shrunken, and Shrunken is 50% and Regular is 100%. The distance of the camera is 1000 for Regular, so set/interp that down to 500 when shrinking occurs, and go back to 1000 if you want to Enlarge again. Spring arms make doing this really really easy, btw.
A little more specifics, hints, and tips, if desired:
Just create a function such as “ResizeCharacter” on the Character, optionally called/invoked from the Controller, that simultaneously scales the character how you like, and the camera distance. If you declare the function on a base character class, such as “CharacterBase”, you have the option to create different implementations for different characters or character types that parent to that base, while not having to change the invocation from the Controller.
Thanks krillin6, the target arm length is exactly what I needed. Works perfectly.