2075 / Unity / 3D / Гравець / Рух з обертанням
Tank |
public float speed = 10.0f; public float rotationSpeed = 100.0f; void Update(){ float translation = Input.GetAxis("Vertical") * speed * Time.deltaTime; float rotation = Input.GetAxis("Horizontal") * rotationSpeed * Time.deltaTime; transform.Translate(0f, 0f, translation); // -translation transform.Rotate(0f, rotation, 0f); } З Rigidbody та на малій швидкості не проходить крізь стіни