Learning Unity is fun!

Create 'Scripts' folder -> go 'Scripts' folder -> right click -> create -> C# Script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
// Start is called before the first frame update

void Start()
{
}

// Update is called once per frame
void Update()
{
}
}
void Update() 
{
transform.Translate(Vector3.forward)
}
void Update() 
{
transform.Translate(Vector3.forward * Time.deltaTime * 20)
}
// in FollowPlayer script
public GameObject player;
void Update()
{
transform.potision = player.transform.position;
}
// in FollowPlayer script 
public GameObject player;
private Vector3 offset = new Vector3(0,5,-7);
void LateUpdate()
{
transform.potision = player.transform.position + offset;
}
public float speed = 20;
public float turnSpeed;

void Update()
{
transform.Translate(Vector3.forward * Time.deltaTime * speed);
transform.Translate(Vector3.right * Time.deltaTime * turnSpeed);
}
public float speed = 20;
public float turnSpeed;
public float horizontalInput;
void Update()
{
horizontalInput = Input.GetAxis("Horizontal");
transform.Translate(Vector3.forward * Time.deltaTime * speed);
transform.Translate(Vector3.right * Time.deltaTime * turnSpeed);
}
public float speed = 20;
public float turnSpeed;
public float horizontalInput;
public float forwardInput;
void Update()
{
horizontalInput = Input.GetAxis("Horizontal");
forwardInput = Input.GetAxis("Vertical");
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput);
transform.Translate(Vector3.right * Time.deltaTime * turnSpeed);
}
public float speed = 20;
public float turnSpeed;
public float horizontalInput;
public float forwardInput;
void Update()
{
horizontalInput = Input.GetAxis("Horizontal");
forwardInput = Input.GetAxis("Vertical");
transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput);
transform.Rotate(Vector3.up, Time.deltaTime * turnSpeed * horizontalInput);
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store