Instantiating Particle Effects ?

How can i instantiate particle effects like the way in video ?

3489754--277866--ezgif-4-821d793008.gif

Looks like they’re probably instantiating a prefab that has a particle system on it. So, to do something like in the video:

  • Create a game object and put a particle system on it, with Play on Awake enabled.
  • Put a script on the game object which changes its position every frame. For example. in Update(), set transform.position += transform.forward * Time.deltaTime * SomeSpeedConstant
  • Put a collider on the game object, and an OnCollisionEnter event on the script to handle the impact with other objects.
  • Put that game object in the a Resources directory.
  • Load the prefab and instantiate the game object in your scene. Set its initial rotation to match the rotation of whatever is firing the projectile.
2 Likes