Einheit - WASD -Bewegung in Einheit 3D
Posted: 05 Apr 2025, 13:10
Hallo nochmal, meine Freunde. Aus der entgegengesetzten Richtung scheinen die Kontrollen umgekehrt zu sein. Auch wenn ich mich mit der Maus umsehe. Das Spiel wird als Ego-Shooter (FPS) angesehen.[SerializeField]
private NavMeshAgent navMeshAgent;
// Start is called before the first frame update
void Start()
{
controller = GetComponent();
}
// Update is called once per frame
void Update()
{
Vector3 direction = new Vector3(Input.GetAxis("Horizontal1"), 0, Input.GetAxis("Vertical1"));
Vector3 velocity = direction * speed;
velocity.y -= gravity;
velocity = transform.TransformDirection(velocity);
controller.Move(direction * Time.deltaTime);
transform.position = navMeshAgent.nextPosition;
}
< /code>
Was soll ich tun? Ich würde Ihre Hilfe wirklich schätzen.
private NavMeshAgent navMeshAgent;
// Start is called before the first frame update
void Start()
{
controller = GetComponent();
}
// Update is called once per frame
void Update()
{
Vector3 direction = new Vector3(Input.GetAxis("Horizontal1"), 0, Input.GetAxis("Vertical1"));
Vector3 velocity = direction * speed;
velocity.y -= gravity;
velocity = transform.TransformDirection(velocity);
controller.Move(direction * Time.deltaTime);
transform.position = navMeshAgent.nextPosition;
}
< /code>
Was soll ich tun? Ich würde Ihre Hilfe wirklich schätzen.