Hey humanity!
I learning Roblox Studio a few days, and I am creating another Obby (I have not found a better way to study the features of the Studio and Lua) and it is not clear to me where the physics goes on the rotating parts.
When I make a part in the form of a connection and a loop with a motor, the player can move along with the rotation of the part.
But when I create a simple Rotator script instead, the part rotates under the player’s feet and doesn’t move it.
Rotator Script
local part = script.Parent
local function randomBetween(min, max)
local RND = Random.new()
return RND:NextInteger(min, max)
end
-- начальный случайный поворот
local initialAngle = math.rad(randomBetween(0,360))
part.CFrame *= CFrame.Angles(0, initialAngle, 0)
while wait(0.01) do
part.CFrame *= CFrame.Angles(0, 0.01, 0)
end
I suspect this is due to the Anchored property. But I don’t know what to change in the script - so that the detail doesn’t slip under the character’s feet.
Thanks and sorry for my english.