Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Instantiating a gameobject with particle effects?

Discussion in 'Getting Started' started by ElectricMonkey, Apr 14, 2015.

  1. ElectricMonkey

    ElectricMonkey

    Joined:
    Mar 10, 2015
    Posts:
    12
    I'm trying to make it so blood particles start playing once the enemy gets shot.

    I know the script is working because it creates a (clone) of the gameObject everytime I shoot the enemy, because I'm instantiating the prefab every time the enemy is shot. However, nothing is showing up. I'ts just empty gameObjects with none of the effects of the children that have the actual particle effects.

    What am i doing wrong here?
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    Without seeing your code, scene hierarchy, or assets, it's tough to say for sure what's going on and what you may potentially be doing incorrectly. Post all relevant code, any errors you're getting, and a couple screenshots and we'll help you figure out what's going wrong.
     
  3. ElectricMonkey

    ElectricMonkey

    Joined:
    Mar 10, 2015
    Posts:
    12

    These blood(clones) spawn upon shooting the enemy, but the effect doesn't play.

    And here is the relevant code:



    "bloody" is a public gameObject linked to the Blood prefab that is supposed to be instantiated.