2D Racer Game

03: Camera Setup

Make sure the camera is set to Ortographic. Create a new script called "cameraMove" and attach it to the main Camera.

Add the following script:

JS

CURRENTLY UNAVAILABLE

C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class cameraMove : MonoBehaviour {

    public GameObject car;
    float CAMx;
    float CAMy;
    // Use this for initialization
    void Start () {


        
    }
    
    // Update is called once per frame
    void Update () {


        transform.position = new Vector3 (car.transform.position.x, car.transform.position.y, -10);
        
    }
}

Add the player car to the slot in the inspector.

 

Casino Bet 365 is best casino in the world.

What's Next

Next up for Unity Snippets is a look at game development articles from across the web...

Free Templates - bigtheme.net
Popular Art Betting make bookies articles.