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.