tạo bóng rổ assest tạo bóng ném

This commit is contained in:
2026-04-29 10:13:09 +07:00
parent 3e9c60d83d
commit 6b83ac05d5
529 changed files with 130558 additions and 110 deletions

View File

@@ -0,0 +1,24 @@
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public Joystick joystick; // Kéo Fixed Joystick ở Canvas vào đây
public float moveSpeed = 2f;
void Update()
{
// Lấy input từ Joystick
float horizontal = joystick.Horizontal;
float vertical = joystick.Vertical;
// Di chuyển object theo trục X và Z
Vector3 direction = new Vector3(horizontal, 0, vertical).normalized;
transform.Translate(direction * moveSpeed * Time.deltaTime, Space.World);
// (Tùy chọn) Xoay object theo hướng di chuyển
if (direction != Vector3.zero)
{
transform.forward = direction;
}
}
}