Camera swing and other changes
When i was in the research phase of my development a game that i looked into for inspiration was Wipe-out, This was mainly for the camera movement and swing as i think it works well with physics based vehicles and adds a nice amount of visual feedback to the player as well. I also feel like the camera game is very important to racing games as they need to be smooth and show off as much of the environment as they can so that the player knows where about they need to be driving next and have the ability to dodge obstacles as well.
When setting the camera up i decided that the ideal way to achieve the camera movement that i wanted was to add the default camera to a spring arm, that way the camera would rotate around the player rather than world space. Once i had added the spring arm i made sure that i am only inheriting the Yaw camera input and no the pawn control rotation as well, I then added a small amount of camera lag as well and rotation lag as well as it adds a bit of flare to the game and adds to the visual feedback of the camera. this was a good base to build upon. I knew that once i had the camera working that i wanted to add camera swing into the game. Before i did this i wanted to make sure that there was no problems with the camera lag speed or the pitch inputs, i tested and realised that the lag speed was slightly higher than i was wanting so i made sure that i changed this from 100 to around 75, I felt that after this slight adjustment that i had the camera how i wanted and was ready to add the swing.
I had a look at a few different ways that i would be able to achieve the camera swing that i had wanted, the only way that would work with how i had the player controller set up would to be to set up 4 variables that would change the speed of the camera swing, swing amount, camera zoom reduction and an overall speed. I have shown my script underneath on how i tackled the camera swing, it was fairly simple as it plugged into the end of my auto orientate script so it made the process a lot easier.
This is how i have worked the camera swing, i have made sure that i have clamped the values so that the camera doesn't swing all the way around the character. I am happy with the way that this has turned out and i have achieved the camera swing that i am wanting.
The last thing that i am wanting to do this week is to create a rear view camera for the vehicle, the reason for this is so that the player can see enemy's behind and also evade attacks. This also comes as standard mechanic in most racing games so i feel like it would be necessary to add it in, It was fairly easy to do all i had done was add in a second camera to my hierarchy and on input i would switch between the two cameras.
This is all i have worked on this week and i feel like i have made some really good advances in my player controller as i have covered the majority of the base work, From here i can start building the level up and obstacles.
- JLP
When setting the camera up i decided that the ideal way to achieve the camera movement that i wanted was to add the default camera to a spring arm, that way the camera would rotate around the player rather than world space. Once i had added the spring arm i made sure that i am only inheriting the Yaw camera input and no the pawn control rotation as well, I then added a small amount of camera lag as well and rotation lag as well as it adds a bit of flare to the game and adds to the visual feedback of the camera. this was a good base to build upon. I knew that once i had the camera working that i wanted to add camera swing into the game. Before i did this i wanted to make sure that there was no problems with the camera lag speed or the pitch inputs, i tested and realised that the lag speed was slightly higher than i was wanting so i made sure that i changed this from 100 to around 75, I felt that after this slight adjustment that i had the camera how i wanted and was ready to add the swing.
I had a look at a few different ways that i would be able to achieve the camera swing that i had wanted, the only way that would work with how i had the player controller set up would to be to set up 4 variables that would change the speed of the camera swing, swing amount, camera zoom reduction and an overall speed. I have shown my script underneath on how i tackled the camera swing, it was fairly simple as it plugged into the end of my auto orientate script so it made the process a lot easier.
This is how i have worked the camera swing, i have made sure that i have clamped the values so that the camera doesn't swing all the way around the character. I am happy with the way that this has turned out and i have achieved the camera swing that i am wanting.
The last thing that i am wanting to do this week is to create a rear view camera for the vehicle, the reason for this is so that the player can see enemy's behind and also evade attacks. This also comes as standard mechanic in most racing games so i feel like it would be necessary to add it in, It was fairly easy to do all i had done was add in a second camera to my hierarchy and on input i would switch between the two cameras.
This is all i have worked on this week and i feel like i have made some really good advances in my player controller as i have covered the majority of the base work, From here i can start building the level up and obstacles.
- JLP
Comments
Post a Comment