To do this we were shown the input manager in Unity where there are preset controls that can be used in the code to make certain actions easier to create, such as movement, shooting, jumping etc. In terms of using transform we were informed about creating a variable to hold the values of Transform rather than making the program retrieve them everytime, which increases the efficiency of the program over all. I was also taught about using Time.deltaTime in calculations for movement as it makes the frame rate independent and causes the game to run smoother.
Monday, 28 September 2015
First Development Session - Movement
In the first weeks development session we were taught how to create a movement script for a character controller. Last year I had only worked with moving objects in a 2D space which meant I only needed to use 2 axes. Today I learnt how to use Transform in terms of moving an object around in 3D world space.
To do this we were shown the input manager in Unity where there are preset controls that can be used in the code to make certain actions easier to create, such as movement, shooting, jumping etc. In terms of using transform we were informed about creating a variable to hold the values of Transform rather than making the program retrieve them everytime, which increases the efficiency of the program over all. I was also taught about using Time.deltaTime in calculations for movement as it makes the frame rate independent and causes the game to run smoother.
Once you've obtained the character transform, to make it move around, when a key is pressed you take it's direction and multiply this by the speed and Time.deltaTime. This result then needs to be added onto the original transforms position, thus making it move.
To do this we were shown the input manager in Unity where there are preset controls that can be used in the code to make certain actions easier to create, such as movement, shooting, jumping etc. In terms of using transform we were informed about creating a variable to hold the values of Transform rather than making the program retrieve them everytime, which increases the efficiency of the program over all. I was also taught about using Time.deltaTime in calculations for movement as it makes the frame rate independent and causes the game to run smoother.
Labels:
Development,
Movement,
Unity
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment