Skip to content

Instantly share code, notes, and snippets.

@keithweaver
Created March 27, 2017 14:18
Show Gist options
  • Save keithweaver/76a65e13ac8e6516b99b80ebb32e35de to your computer and use it in GitHub Desktop.
Save keithweaver/76a65e13ac8e6516b99b80ebb32e35de to your computer and use it in GitHub Desktop.
Move object forward from left to right in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CharacterMovement : MonoBehaviour {
public float movementSpeed = 5.0f;
void Start() {
Debug.Log("Start");
}
void Update() {
// Updates the position and moves it to the right
transform.position += Vector3.right * Time.deltaTime * movementSpeed;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment