Created
March 27, 2017 14:18
-
-
Save keithweaver/76a65e13ac8e6516b99b80ebb32e35de to your computer and use it in GitHub Desktop.
Move object forward from left to right in Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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