Topic: Move Particle Effects

Not sure if this was missed or is already fixed for next update, but the Sticky and Bodypart variables on Particle Effects don't work (I kept getting a null exception error when the particles were cast, but non-sticky works fine).  I was in the process of doing a convoluted hack to access the character's bone transforms, when I eventually noticed you have a HitBoxesScript.getTransform.  This works GREAT!  We can now create simple particle effects to simulate slashes and attack lines without need of baking into FBX (which I have no idea how to do anyway tongue).

So here's the single line of code that needs to be changed to make it work properly (the particle to stick to the body part):

In ControlScript.cs, change:

if (particleEffect.particleEffect.stick) pTemp.transform.parent = transform;

to:

if (particleEffect.particleEffect.stick) pTemp.transform.parent = myHitBoxesScript.getTransform(particleEffect.particleEffect.bodyPart);

Share

Thumbs up +2 Thumbs down

Re: Move Particle Effects

Sweet! I'll have to give this a try later this week, was having some weird particle issues a few months back and decided to just ignore it when I couldn't find a solution. Thanks in advance big_smile

Share

Thumbs up Thumbs down

Re: Move Particle Effects

I Gotta update it right NOW! Thanks!

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.

Re: Move Particle Effects

if (particleEffect.particleEffect.stick) pTemp.transform.parent = myHitBoxesScript.getTransform(particleEffect.particleEffect.bodyPart);

in this code change "getTransform" to "GetTransform" or it will pop an error, Thanks to Shubi for pointing that out!

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.

Re: Move Particle Effects

Hi!

Mmm... i started a new project and added this option again as it wasn't yet implemented in the code, but it doesn't work either way. Has something changed dramatically in the code?

Thanks

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.

Re: Move Particle Effects

Hi!

i'm very bad at coding, but basically took all the "check particle effects" section in ControlScript.cs

from my old project, put it in the new one, and it works great.

        foreach (MoveParticleEffect particleEffect in move.particleEffects){
            if (
                !particleEffect.casted && 
                particleEffect.particleEffect.prefab != null &&
                move.currentFrame >=  particleEffect.castingFrame
                ){
                particleEffect.casted = true;
                GameObject pTemp = (GameObject) Instantiate(particleEffect.particleEffect.prefab);
                
                Vector3 newPosition = myHitBoxesScript.GetPosition(particleEffect.particleEffect.bodyPart);
                newPosition.x += particleEffect.particleEffect.offSet.x * -mirror;
                newPosition.y += particleEffect.particleEffect.offSet.y;
                newPosition.z += particleEffect.particleEffect.offSet.z;
                pTemp.transform.position = newPosition;
                if (particleEffect.particleEffect.stick) pTemp.transform.parent = myHitBoxesScript.GetTransform(particleEffect.particleEffect.bodyPart);
                if (particleEffect.particleEffect.mirrorOn2PSide && mirror > 0) {
                    pTemp.transform.localEulerAngles = new Vector3(pTemp.transform.localEulerAngles.x, pTemp.transform.localEulerAngles.y + 180, pTemp.transform.localEulerAngles.z);
                }
                Destroy(pTemp, particleEffect.particleEffect.duration);
            }
        }
Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.