Hello everyone, this is my very first tutorial on this awesome forum
I wan to share some very simple stuff i made playing round
In this tutorial i will show you how to change the distance of the character’s camera while playing.You can also go from third person to first person, of course this is not optimized for first person shooter but you can try tweaking the CameraBoom position to have the best experience possible.
1- Of course for this tutorial you have to add a SpringArm component attached to the root component and a Camera component attached to the SpringArm
2-Then add two variables:
Distances: Float, also make it as Array
3- Add some values to the array, i’ve tested some comfortable distances shown here:
The 300.0 quite a standard distance used in third person template, then i added a very near distance (100.0), a first person vew (0.0) and a very far view (500.0).
4- Lets make go further to the blueprint.
In this graph i use the Set Target Arm Leght, targeting the Spring Arm, to get the new lenght i get the distance value form Distance Array at the DistanceIndex index, when you start the game it will look at the first index (0) so the 300.0 value.
After updating the Spring Arm lenght i also update the DistanceIndex by addi 1, so the next time you call the function it will chek the next value.
And finally it calls CheckIndex custom function:
The function will check if DistanceIndex is bigger than the last index of the array (in this case 3) and, if the value IS bigger it will set 0 again, so next camera setting will be the first distance setting again.
I made this tutorial to store this on the forum in case i need one day and also to share simple stuff with beginner who need help. I hope to improve this time by time by making it better and adding features, but i since i’m studying for University i will try my best to be more active as i can.
Also fell free to share improvements or ask questions, for any grammar errors [COLOR="#FF0000"]PLEASE forgive me as i’m Italian and i’m not very handy writing in english.[/COLOR]