26 lines
466 B
C#
26 lines
466 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PlayerMovement : MonoBehaviour
|
|
{
|
|
|
|
public Rigidbody rb;
|
|
|
|
public float forwardForce = 1000f;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void FixedUpdate()
|
|
{
|
|
if (Input.GetKey("w")) {
|
|
rb.AddForce(forwardForce * Time.deltaTime, 0, 0);
|
|
}
|
|
}
|
|
}
|