Pages 1
Universal Fighting Engine Forum We are no longer using the forum to answer questions due to bot attacks. Please use our discord instead: https://discord.gg/hGMZhF7 |
You are not logged in. Please login or register.
Universal Fighting Engine Forum → Source Coding → 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?
> 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.
How exactly are you playing or spawning the particles?
If you can provide screenshots that would help me out.
@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.
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.
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
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)
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)
{
}
}
}
@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)
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?
@xFTLxKingPhoenix - Correct. I am using the projectiles tab
Universal Fighting Engine Forum → Source Coding → Destroy a character's particle effect after they get hit
Powered by PunBB, supported by Informer Technologies, Inc.