here’s my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Move : MonoBehaviour
{
Vector3 Position = new Vector3(1.0f, 1.0f, -25.0f);
const int SPEED = 5;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKey("w"))
{
Position += new Vector3(0, SPEED * Time.fixedDeltaTime, 0);
}
if (Input.GetKey("s"))
{
Position += new Vector3(0, -SPEED * Time.fixedDeltaTime, 0);
}
if (Input.GetKey("a"))
{
Position += new Vector3(-SPEED * Time.fixedDeltaTime, 0, 0);
}
if (Input.GetKey("d"))
{
Position += new Vector3(SPEED * Time.fixedDeltaTime, 0, 0);
}
transform.position = Position;
}
}