Hello everyone,
in my previous post (New camera system | Prevent camera from jumping with character) I tried to create a camera system where the camera stays fixed and doesnt jump with the character.
We managed to solve this in the previous post.
Its important that you read the previous post to understand the issue in this one here
Now the issue is that in certain cases e.g. when character is being launched or double jumps, the character goes out of frame since the camera is fixed on the Z value.
I tried to solve this by adding a toggle to event tick event called “camera follows”
Tge “SetDefaultCameraLocation” node is the functionality from the previous post. This is only being played when “camera follows” is false. If camera follos is true, the camera does behave like it usually does as a default 3rd person camera.
The idea was to toggle this on and off when the distance between the character Z and the camera Z is greater than a certain distance, indicating that the character starts going out of the camera frame.
If thats the case, the camera should follow. The logic for this is inside “Is Character Leaving Camera Frame”
First part:
The “false” part of the branch:
Currently, it looks like this in motion:
As you can see the camera follows the character when it double jumps to keep it inside the frame.
However there are 2 isssues:
The first one being if the character is launched like on the launch pad and lands, the interpolation starts clipping on landing.
The second problem is when the character jumps BEFORE the interpolation on landing finishes, this happens:
What happens in the second issue is that the camera jumps above the character head for a second and goes right back to its previous position. The reason for this is that the default position of the spring arm is right above the head. So I guess theres an interpolation error when the character jumps BEFORE the camera is at its new interpolated location.
This only happens ONCE if the character jumps AFTER landing on a NEW floor
My guess is that this solution is completly wrong and there is another way to make the camera follow the character if it starts going out of frame.
Any ideas?
Thanks for your help,
-Ekveel