Child appears to rotate differently to parent

OK, I’ve asked this before, but I don’t think I was specific/clear enough to allow anyone to answer, so I’ll try again…
On my NPC aircraft is a gun barrel, which has a child cylinder acting as a laser to show where the barrel is pointing from a distance.
The barrel is moved by a script that Slerps it to target. The script works fine, and I don’t think it’s relevant to the problem, since the barrel it’s moving points exactly where it’s meant to.
The problem is, when the barrel rotates, the laser moves in roughly the same direction, but appears to rotate around it’s own centre some, so it’s no longer in line with the barrel. According to the inspector panel, the laser rotation values don’t change at all, like you’d expect, so surely it should stay in line with the barrel? I have a before and after pic, plus a (terrible quality) video:

Before aiming happens, laser in line with barrel:

When target has been acquired, and barrel has Slerped around to point at target:

And a video showing it happen: Link here

I’m at a loss. The laser points in the right direction (ish), but is appearing to rotate around the middle of the cylinder, even though the inspector says it isn’t.
The laser is a Unity primitive cylinder without a collider btw, I’ve tried subbing in a model cylinder from Blender with the same effect.
Is this a bug? How Unity should work?
Can anyone shed any light please?
Many thanks

Ian

I think this has to do with a parenting issue (and maybe a potential bug?) The cylinder is trying to match the rotation of the parent, but it’s center isn’t at the same point as the parent’s center. I bet if you moved the cylinder’s center to the center of the parent, the rotation would match just fine (but it would be jutting through the ship of course)

watches video

Ah, maybe this is your problem! Did you perhaps scale the cylinder? That could be messing up the child transform calculations built-in to Unity. I’d try making a giant cylinder mesh in a 3D modeling program and using that. But make sure the new one’s scale is “1 1 1”. You can make it as big as you want in the modeling program, but be sure not to scale it at all in Unity.

Sequence - I tried the scale thing with an imported Blender cylinder to no avail, but did manage to sort it.

In Blender I moved the Origin to the end of the model, reimported it, and it works! It seems Unity uses the Origins from models imported from Blender, which is useful to know.
I still reckon it should work using primitives from Unity, so maybe there’s still a bug?
Anyway, I appreciate your help.

Regards

Ian