Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class movee : MonoBehaviour
- {
- public GameObject Car;
- public int speed1;
- public int speed2;
- public int bonus;
- // Start is called before the first frame update
- public static movee instance;
- void Start()
- {
- if (instance == null)
- {
- instance = this;
- }
- }
- // Update is called once per frame
- void Update()
- {
- Car.transform.Translate(0, 0, speed1 * Time.deltaTime);
- Car.transform.Rotate(0, speed2 * Time.deltaTime, 0);
- }
- public void vpered()
- {
- speed1 = 3;
- }
- public void nazad()
- {
- speed1 = -3;
- }
- public void left()
- {
- speed2 = -100;
- }
- public void right()
- {
- speed2 = 100;
- }
- public void stop()
- {
- speed1 = 0;
- speed2 = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement