Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Project: Roll-a-Ball / Game view and Play not working

Discussion in '2D' started by Mt.Erudition, Jun 10, 2014.

  1. Mt.Erudition

    Mt.Erudition

    Joined:
    Jun 10, 2014
    Posts:
    7
    I have completed everything the first script in video 3 of Project: Roll-a-Ball.

    It hasn't mattered too much until now that the Game View and Play does not work. It's just a blue screen.

    When I select the main camera in hierarchy the preview window is also blank.

    When I press play, the ball does not roll around in ANY view as it does in the video. However, the position numbers are changing.

    I tried to post this in answers, but the page is broken.

    GameViewProblem.jpg
     
  2. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    Your main camera looks all wrong. Mine is:

    Pos: 0, 10, -10
    Rot: 45, 0, 0

    Projection: Perspective
     
    Mt.Erudition likes this.
  3. Mt.Erudition

    Mt.Erudition

    Joined:
    Jun 10, 2014
    Posts:
    7
    Awesome. I can now see the ground and ball in game view!
     
    Last edited: Jun 10, 2014
  4. Mt.Erudition

    Mt.Erudition

    Joined:
    Jun 10, 2014
    Posts:
    7
    The ball still won't roll around when I press play.

    The Speed option does not show up in the Inspector with the script.
    "Assets/Scripts/PlayerController.cs(15,55): error CS0103: The name `time' does not exist in the current context"
     
    Last edited: Jun 10, 2014
  5. Mt.Erudition

    Mt.Erudition

    Joined:
    Jun 10, 2014
    Posts:
    7
  6. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    Maybe post your script? If the public variable didn't appear, it most likely did not compile correctly.
     
  7. Mt.Erudition

    Mt.Erudition

    Joined:
    Jun 10, 2014
    Posts:
    7
    using UnityEngine;
    using System.Collections;

    public class PlayerController : MonoBehaviour
    {
    public float speed;

    void FixedUpdate ()
    {
    float moveHorizontal = Input.GetAxis ("Horizontal");
    float moveVertical = Input.GetAxis ("Vertical");

    Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);

    rigidbody.AddForce(movement * speed * time.deltaTime);
    }
    }


    "Assets/Scripts/PlayerController.cs(15,55): error CS0103: The name `time' does not exist in the current context
     
  8. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    "Time" not "time". Capitalization matters - a lot.