Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public float Forwardforce;
- public float Maxspeed;
- // Update is called once per frame
- void Update()
- {
- transform.localPosition += transform.forward * Forwardforce;
- if (Input.GetKey("w") && Forwardforce < Maxspeed)
- {
- Forwardforce += 0.01f;
- }
- if (Input.GetKey("w") && Forwardforce > 0.2f)
- {
- Forwardforce -= 0.03f;
- }
- if (Input.GetKey("a"))
- {
- transform.Rotate(0, -1, 0);
- }
- if (Input.GetKey("d"))
- {
- transform.Rotate(0, -1, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement