I’m welding a part that has Spotlight as a child to HumanoidRootPart as .Part1 (parented to the character), and the direction the part looks at seems to be correct.
However, whenever I look down or up, my character decides to fling, and other weird scenarios. What seems to be the issue here?
--light is the Spotlight's parent (part)
light.CFrame = CFrame.lookAt(light.Position, mouse.Hit.p)
I’m guessing this is a tool, like a flashlight?
Make sure all the Parts in your tools have the Massless Property set to true so their weight doesn’t affect the Humanoid.
It’s meant to be a flashlight, but it’s a part with a spotlight that gets cloned in the player’s character:
I tried setting the .Massless to true, but it seemed to not help as much.
Not sure if the welding has something to do with this, but I’ll see if I get different results.
local root = char.HumanoidRootPart
local clone = light:Clone()
clone.Parent = char; clone.Position = root.Position
local weld = Instance.new("WeldConstraint"); weld.Parent = clone
weld.Part0 = clone; weld.Part1 = root
The part is always in the same position (to HumanoidRootPart). I wanted to create an effect so the flashlight moves with the cursor (or camera), as seen above - not static in a spot.