How to make a SpotLight follow the player's mouse

the Part is inside the head [which is cancolide off] and the spotlight is inside the part.

also heres whats the problem:

1 Like

I anchored the part so the player doesnt move

1 Like

Thats probably because you welded the part to the character. Unweld it and id suggest you position the part with a loop

1 Like

how do i do that? [this text is here because the minimum character limit is 30]

1 Like

You can put this in the same loop as the previous one: (also, this isn’t the best solution, but the other would be complicated)

local offset = Vector3.new(0, 1, 0) -- this is how much you want the light to be offset from the head
--right now the offset is 1 stud above the player's head
LIGHT.Position = plr.Character.Head.Position + offset -- LIGHT is the part that the SpotLight is in

Edit: only the LAST line should be inside the loop

3 Likes

Omg it finally works! thank you!

2 Likes

Please mark the answer as the solution if it worked

1 Like