He "Automotive" in query is an airplane. The query is self-explanatory.
Right here is the automotive within the hierarchy:
Right here is the automotive on the inspector:
And right here is the PlayerMovement script:
utilizing UnityEngine;
public class PlayerMovement : MonoBehaviour
{
// --------------------------------
// References
// --------------------------------
public Rigidbody rb;
// --------------------------------
public float drive = 500f;
void FixedUpdate()
{
if (Enter.GetKey("w") || Enter.GetKey("up"))
{
Debug.Log("Foreward");
rb.AddForce(0, 0, drive * Time.deltaTime);
}
if (Enter.GetKey("a") || Enter.GetKey("left"))
{
rb.AddForce(-force * Time.deltaTime, 0, 0);
}
if (Enter.GetKey("s") || Enter.GetKey("down"))
{
rb.AddForce(0, 0, -force * Time.deltaTime);
}
if (Enter.GetKey("d") || Enter.GetKey("proper"))
{
rb.AddForce(drive * Time.deltaTime, 0, 0);
}
}
}
Reveals the "ahead" log in once I press W or the up arrow so I do know it is working.
(Facet observe: I do know this may not get me began on the precise physics of the automotive, I am simply attempting to verify I can transfer the automotive first)


