Einheit - WASD -Bewegung in Einheit 3DC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Einheit - WASD -Bewegung in Einheit 3D

Post by Anonymous »

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.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post