- Home /
Ball vs holes and enemies
I am creating a game in unity and the things it's suppose to have is
moving player (ball) through a maze based off of user input.
holes in the playing surface, player is returned to start if fall off playing surface.
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); } }
you're not expecting someone to write all the rest for you, are you?
please narrow your question down to something that can be answered without writing a book.
Your answer
Follow this Question
Related Questions
Cannot move FPSController after respawning at a spawn point. 1 Answer
Trigger Respawn 1 Answer
Fire to the multiple Enemies For 5 to 6 times 0 Answers
If trigger hit, spawn it 1 Answer
Collisions, tags, and enemy types 1 Answer