Unable to play particle system via script.

using UnityEngine;
using System;
using UnityEngine.EventSystems;

public class PlayerMovement : MonoBehaviour
{
    public ParticleSystem Trail;
        if (AbilityReady == true && GameOver.GameEnded == false && dashButtonPressed == true && lastDirection == "Right")
        {
            dashButtonPressed = false;
            ChargingToD = true;
            WaitForSecondsD = Time.time;
            DashAnimation.Play("PlayDash");
            Trail.Play();
        }
        if (ChargingToD == true && Time.time > WaitForSecondsD)
        {
            ChargingToD = false;
            transform.Translate(-3.5f, 0, 0);
            AbilityCurrentCooldown = AbilityCooldown;
            Charging = AbilityCooldown;
            ArrowToCharge = 3;
            AbilityReady = false;
        }
        if (AbilityReady == true && GameOver.GameEnded == false && dashButtonPressed == true && lastDirection == "Left")
        {
            dashButtonPressed = false;
            ChargingToA = true;
            WaitForSecondsA = Time.time;
            DashAnimation.Play("PlayDash");
            Trail.Play();
        }
        if (ChargingToA == true && Time.time > WaitForSecondsA)
        {
            ChargingToA = false;
            transform.Translate(3.5f, 0, 0);
            AbilityCurrentCooldown = AbilityCooldown;
            Charging = AbilityCooldown;
            ArrowToCharge = 3;
            AbilityReady = false;
        }
    }
}

After using print (Trail.isPlaying), i found out that the trail is actually playing, the effects just don’t appear or something similar.



If i put the particle on loop then it works… But it always plays which I don’t want.

You’re using rate over distance. So the system will only emit particles if the source is moving. Is it? Also the duration is .1 seconds, is the source moving much over the course of a tenth of a second?

well the idea is when it teleports around 6 cubes are made behind the player. it worked fine before i switched everything to android and changed the controls from a d to the buttons
Thats why i am so confused…

I give up. Problem was Emitter velocity in particle was set to rigidbody, i set it to transform and it worked. Please explain if you know i want to understand whats going on so i dont do this stupid mistake again.