
Какая цель | Лучше выбрать | Почему |
Сделать первую игру быстро | 2D | Меньше настроек и ошибок |
Хочется катать шарик/гонки/арену | 3D | Удобнее физика и пространство |
Тянет к мультяшным персонажам | 3D | Проще визуально развиваться |

using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float speed = 10f;
private Rigidbody rb;
private int score = 0;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
rb.AddForce(movement * speed);
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Pickup"))
{
other.gameObject.SetActive(false);
score++;
Debug.Log("Счет: " + score);
}
}
}
using TMPro;
public TMP_Text scoreText;
void Start()
{
rb = GetComponent<Rigidbody>();
scoreText.text = "Счет: 0";
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Pickup"))
{
other.gameObject.SetActive(false);
score++;
scoreText.text = "Счет: " + score;
}
}
using UnityEngine;
public class RotateObject : MonoBehaviour
{
public float rotationSpeed = 50f;
void Update()
{
transform.Rotate(0, rotationSpeed * Time.deltaTime, 0);
}
} 