Next, we set up our Bullet prefab with two orthogonal planes using a laser-like material and a Particles/Additive property in the Shader field:
![](https://static.packt-cdn.com/products/9781789533910/graphics/assets/1791a9fd-352a-4a4f-a192-210859588f8a.png)
Our Bullet prefab
The code in the Bullet.cs file is as follows:
using UnityEngine; using System.Collections; public class Bullet : MonoBehaviour { //Explosion Effect
[SerializeField] private GameObject Explosion;
[SerializeField]
private float Speed = 600.0f;
[SerializeField]
private float LifeTime = 3.0f;
public int damage = 50; void Start() { Destroy(gameObject, LifeTime); } void Update() { transform.position += transform.forward * Speed * Time.deltaTime; } void OnCollisionEnter(Collision collision) { ContactPoint contact = collision.contacts[0]; Instantiate(Explosion, contact.point, Quaternion...