May 2018
Beginner
492 pages
11h 53m
English
This time, we'll attach the script to a new empty GameController object by performing the following steps:
Here's the completed KillTarget.cs script:
using UnityEngine;
using System.Collections;
public class KillTarget : MonoBehaviour {
public GameObject target;
public ParticleSystem hitEffect;
public GameObject killEffect;
public float timeToSelect = 3.0f;
public int score;
private float countDown;
void Start () {
score = 0;
countDown = timeToSelect;
}
void Update () { Transform camera = Camera.main.transform; Ray ray = new Ray (camera.position, camera.rotation ...Read now
Unlock full access