- Home /
Particle System staying at the tip of my weapon during animations
Hi everyone,
I'm trying to get a particle system to stay at the tip of my characters wand. If googled and looked around and a lot of people say "just drag it in the hierachy on to the bone and it will follow". Well I did that and positioned the ps on the right place and it follows my characters but it's not really following exactly.
So now if put a small sphere in blender3d at the tip and it follows nicely when I play the different animations.
My idea was that I could write a script that gets the position from the small sphere which is an extra object and child of my char in unity and use it to apply it in update to the particle system.
Can anyone confirm that this way would be possible or what would be the best practice for something like that?
I've tried to script it but I'm just starting to try scripting my self so I have no Idea if it's just not possible or I just suck at scripting ;)
Answer by Cherno · Sep 23, 2014 at 09:43 PM
If you make your particle object a child ob any other object (like, say, the weapon), it will always stay at the same exact relative to it's parent. For a weapon muzzle flash, I would just make it a child of the weapon, and move it to the weapon object's model's muzzle and rotate it the right way. You can do this via script with
muzzleflashObject.transform.parent = weaponObject.transform
I don't understand you alternative approach, you never explain what the "small sphere" is or what it's supposed to do.
thank you very much. I added the sphere in blender at the tip of the wand so it would act as my muzzleflashObject.
I already had the particle object as child of the sphere (which moves with my animation) it laso moves but with a slight offset. But I didn't had a script on it. I thought it would work without.
I will give it a try.
If the particle object is a child of the weapon object, then it shouldn't be neccessary to use any further code. Not sure where the slight offset comes from.
Your answer
Follow this Question
Related Questions
What is the better way to set up a character with a weapon? 1 Answer
Switching weapons animation with mecanim? 2 Answers
Character Equip Animation 0 Answers
Realistic weapon movement with the character 0 Answers
Animation system 1 Answer