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:
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...