Project
Roll-a-ball
Environment and Player
Tutorial
Beginner
25 Mins
Unity Technologies
Overview
You have completed 0% of this Tutorial.
1.
Setting up the Game
2.
Moving the Player
Summary
Creating a new project and setting up the basic game.
Language
English
Recommended Unity Versions
5
1.
Setting up the Game
Creating a new project and setting up the basic game.

2.
Moving the Player
Moving the player object using player input and physics forces.
This is the current state of this script, as of the end of this lesson. This script will continue to change and mature in later lessons.

PlayerController

using UnityEngine; using System.Collections; public class PlayerController : MonoBehaviour { public float speed; private Rigidbody rb; void Start () { rb = GetComponent<Rigidbody>(); } void FixedUpdate () { float moveHorizontal = Input.GetAxis ("Horizontal"); float moveVertical = Input.GetAxis ("Vertical"); Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical); rb.AddForce (movement * speed); } }

Woohoo! You nailed this tutorial.
Continue rocking your Roll-a-ball project.
Next Step:
Camera and Play Area
Tutorial
Beginner
10 Mins
Unity Technologies