Making A Simple Game Part 1 - Simple Movement Script

Channel:
Subscribers:
1,060
Published on ● Video Link: https://www.youtube.com/watch?v=ZiCMUGOE2k0



Duration: 8:31
21 views
2


Hello there,

Today we are going to use unity to make a very simple game, starting with the Movement Script

The script is included below

sing System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMove : MonoBehaviour
{

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
if (Input.GetKey (KeyCode.D))
{ transform.position += Vector3.right * 5 * Time.deltaTime; }

if (Input.GetKey(KeyCode.A))
{ transform.position += Vector3.left * 5 * Time.deltaTime; }

if (Input.GetKey(KeyCode.W))
{ transform.position += Vector3.up * 5 * Time.deltaTime; }

if (Input.GetKey(KeyCode.S))
{ transform.position += Vector3.down * 5 * Time.deltaTime; }







Tags:
C++
Unity
Simple
MovementScript
MovinginUnity
GameDev
Dev
IndieGameDev
Visual
Visualstudios
simplemovementscripts
simple movement scripts
moving in c++
Transform
Transform.position
Game Dev
Game Devolpment