I am currently making a game that involves two revolving turntables, however, sometimes it breaks and doesn’t carry the player as it spins. Is there a local script I can add to the model to force the player to move with it, but only when it is turning? The turntable does stop and start spinning, so I can’t just change the AngularVelocity. Before and after examples below:
This is the script that manages the turn:
local TweenService = game:GetService("TweenService")
local Config = script.Parent
local Speed = Config.Speed
Speed:GetPropertyChangedSignal("Value"):Connect(function()
local tween = TweenService:Create(
script.Parent.Parent.TableModel.root.HingeConstraint,
TweenInfo.new(2.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out),
{AngularVelocity = Speed.Value}
)
tween:Play()
end)
This is the script that starts and stops the turn (enabled by a button):
s = script
g = game.Workspace
local a = false
local ts = game.TweenService
local twi= game.TweenService
local TweenService = game:GetService("TweenService")
------------------------------------------
local turnTables = {
workspace.TurntableModel,
workspace.TurntableModel2,
}
local spinning = false
if not spinning then
spinning = true
game.workspace.TurntableModel.Turntable.Config.Speed.Value = 0.2 --speed of outer
game.workspace.TurntableModel2.Turntable.Config.Speed.Value = 0.2 --speed of center
spinning = false
end
wait(10)
local turnTables = {
workspace.TurntableModel,
workspace.TurntableModel2,
}
local spinning = false
if not spinning then
spinning = true
game.workspace.TurntableModel.Turntable.Config.Speed.Value = 0 --speed of outer
game.workspace.TurntableModel2.Turntable.Config.Speed.Value = 0 --speed of center
spinning = false
end
```