Im trying to make a searchlight beam that rotates around and you die if it catches you, and the model above it rotates around in circles (which works perfectly fine at the moment, its the searchlight attached to the model that isnt working)
This script should change the position to the motor’s parent’s (block) position and then rotate. However when i run this in a game or test it, it just flies off into the distance and i am so confused.
Some solutions i have tried are using Orientation, but when i do that roblox simply stops the script at 89,0,0 and then starts freaking out by jumping from 90,0,0 to 89,0,0, so that did not work. Im wondering if anyone can find the issue?
I’ve also changed the wait time to () and used task.wait, but neither of those fix my issue of the model flying into the distance.
This exact code i have used in another game before but it just now stopped working.
Can someone help me? because im stumped here.
while true do
script.Parent.Position = script.Parent.Parent.Position
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,-0.005 ,0)
wait(0.01)
end
structure (How the blocks are sorted in explorer)
Part
–MotorPart
----Script
I dont know if that helps at all, but i’ll still put it here.
I can attach videos of how the model behaves if needed.