How to add linerenderer to childobject of an animated character?

Hi,

I have an animated charater with a pistol as a childobject. I created the charater model including the pistol as separate model in Cinema4D, rigged it on MIxamo.com and imported the fbx to Unity. So far the pistol GameObject is following the character animation. But now I want to add a linerenderer in front of the pistol to create a laser beam.

If I place the empty GameObject with the linerenderer as child object in front the pistol, it stays at this position as soon as the game starts. It’s not following the movement of the parent.

How can I do that?

Thanks in advance

Frank

174695-bildschirmfoto-2021-01-23-um-134844.png

I found the answer on my own. I had to add the linerenderer as child of the bone of the right hand in the mixamorig_Hips object, instead of placing it as child to the pistol.