November 2017
Beginner to intermediate
360 pages
6h 40m
English
With all of the stuff we've been talking about, we can now have the final version of the script, which looks like the following:
using UnityEngine; /// <summary> /// Responsible for moving the player automatically and /// reciving input. /// </summary> [RequireComponent(typeof(Rigidbody))] public class PlayerBehaviour : MonoBehaviour { /// <summary> /// A reference to the Rigidbody component /// </summary> private Rigidbody rb; [Tooltip("How fast the ball moves left/right")] public float dodgeSpeed = 5; [Tooltip("How fast the ball moves forwards automatically")] [Range(0, 10)] public float rollSpeed = 5; /// <summary> /// Use this for initialization /// </summary> void Start () { // Get access to ...