Topic: Destroy a character's particle effect after they get hit

I create particle fields for characters that emit energy fields or when they are trying to summon an energy projectile. If the character is hit by an opponent, that particle effect still remains.

Is there a way to destroy a character's particle effect after they get hit?

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

what is your particle Implementation?
Are you using UFE to emit these particles?
Are you doing a particle system separate from UFE?

Share

Thumbs up +1 Thumbs down

Re: Destroy a character's particle effect after they get hit

> what is your particle Implementation?

I'm using sprite-based particles.

> Are you using UFE to emit these particles?

Yes, but I'm not using UFE's particles.

> Are you doing a particle system separate from UFE?

I'm using sprite-based particles.

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

How exactly are you playing or spawning the particles?

If you can provide screenshots that would help me out.

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

@FreedTerror Sorry for the late reply. I didn't notice your comment.

I'm playing my particles through the normal UFE editor. I bought my own particles from the Unity Asset Store and imported them into my project.

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

Just spit balling but you could create a static manager or scriptable object system that uses a list to keep track of the prefabs you want to destroy.
Then use UFE.Onhit to do the destroy logic.

Share

Thumbs up +1 Thumbs down

Re: Destroy a character's particle effect after they get hit

Sorry, I'm trying to better understand how UFE.Onhit works.

I was looking at sample code and found this: UFE.OnHit += this.OnHit;

Is UFE.OnHit tracking all hits in the battle? And dose "this.OnHit" refer to a specific object?

Also also found this UFE.OnMove += YourFunctionHere;

Perhaps YourFunctionHere could be something like DestroyMe if I assign it to specific prefab

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

so the question Freedterror is asking apollo

are you using the move editor to create particle effects
are you using the move set editor from the character window to create particles

like what are you doing in game to create the particles.

are using a basic move like walking jumping etc

or are you doing a special move. ( moves that require a move file)

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

Until you've actually used UFE events it can be tricky to make sense of what to do.
Here is a script to help you get started with using them.

OnHit will execute on an actual hit.
OnBlock and OnParry also exist if you need those.

using UnityEngine;
using UFE3D;

namespace FreedTerror
{
    public class UFE_2EventTemplate : MonoBehaviour
    {
        // Start is called before the first frame update
        void Start()
        {
            SubscribeToUFE2Events();
        }

        // Update is called once per frame
        void Update()
        {

        }

        void OnDisable()
        {
            UnsubscribeFromUFE2Events();
        }

        void OnDestroy()
        {
            UnsubscribeFromUFE2Events();
        }

        public void SubscribeToUFE2Events()
        {
            UFE.OnHit += this.OnHit;
        }

        public void UnsubscribeFromUFE2Events()
        {
            UFE.OnHit -= this.OnHit;
        }

        public void OnHit(HitBox strokeHitBox, MoveInfo move, Hit hitInfo, ControlsScript player)
        {

        }
    }
}

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

@xFTLxKingPhoenix

> are you using the move editor to create particle effects

I'm using a basic move editor to create particle effects.

> are using a basic move like walking jumping etc

Yes, I'm using basic moves like walking and jumping. When the character does either of these moves, dirt particles appear underneath the character


> or are you doing a special move. ( moves that require a move file)

Yes, I'm especially doing this for special moves. For example, when I create a fireball projectile move, particles are appearing from the character when they execute the move. When I create a dragon punch type move, particles appear from that characters. When dragon punch move is canceled or interupted, the particles still appear (but that's an error)

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

im assuming where you have these particles appear. that you are not using the projectile tab and instead you are using the particles. with "Destroy when move ends" turned on, right?

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down

Re: Destroy a character's particle effect after they get hit

@xFTLxKingPhoenix - Correct. I am using the projectiles tab

Share

Thumbs up Thumbs down