Question: I am creating a game in unity and the things it's suppose to have is -a moving player (ball) through a maze based off of
I am creating a game in unity and the things it's suppose to have is
-a moving player (ball) through a maze based off of user input.
-3 holes in the playing surface, player is returned to start if fall off playing surface.
-3 enemies that oscillate somewhere in the maze. player dies if it collides with enemy, input is then given to user to say "Game Over!"
I need help putting together my player script to do these things.
This is what i have so far.....
using System.Collections;
using System.Collections.Generic;
using UnityEngine; public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start () {
rb = GetComponent ();
} void FixedUpdate ()
{ float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
