Having spent about half hour doing this short refresher we continued with our game project.
We added a new line code to the PlayerController script to stop the player ship from moving out of the game screen, with the new line added the script looked like this:
We then created a new set class and added four variables in to that. We then tweaked the code to find the variables.
After this we then started a new coding within the same script, to make the ship to rotate when it moves. to do this we created a tilt variable, and then linked it to the ship's rotation.
To make the ship rotate we used the following code:
After we finished making the ship move we created a quad, and added it to an empty game object that will store the code. Then we created a new material and added a texture to it.
To remove the black edge that appeared over the bolt component, we changed the shader to a Additive Particle getting rid of the black edge. We then added a rigidbody component to the "Bolt" empty gameobject to run the code.
Lastly to wrap the session up we added a cylindrical colider and shaped it to roughly fit the texture.
No comments:
Post a Comment