Hi everyone, I want to add a particle system so that everyone of the objects I instantiate have it. How can I do that? Thank you. Below’s the code.
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class BallsAttack : MonoBehaviour
{
private float Force = 0.15f;
public GameObject Sphere;
public bool Enabled = true;
void FixedUpdate()
{
if (Enabled)
{
if (levelTime % 2 == 0 && levelTime != 0)
{
if (levelTime <= 30)
{
GameObject clone = Instantiate(Sphere, new Vector3(10, 12, -1), Quaternion.identity) as GameObject;
clone.transform.SetParent(gameObject.transform);
clone.GetComponent<Rigidbody2D>().gravityScale = 0.5f * Force;
clone.name = "b_standard";