I am making an obby and have a spinning part players can stand on, I used tween and align position to make the players be able to stand on the part. It actually works fine at first then after about 15-20 seconds into testing the players stops being able to stand on the spinning part and the spinning part just falls from underneath them. This is really weird and I have no idea what might cause this. By the way the spinning part is actually a union, I don’t think it changes anything but just fyi.
local TweenService = game:GetService("TweenService")
local model = script.Parent
local ref = model.Reference
local tweeninfo = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, false, 0)
local properties = {Orientation = Vector3.new(0, 360, 0)}
local tween = TweenService:Create(ref, tweeninfo, properties)
tween:Play()
I tested it myself and i had no such problem (i tested it with both a part and union), i think it’s because of the Union. You should try to just use Parts and if you were to use multiple parts weld them together.
Rotating an object with cframe does not cause any physical changes to its touching parts.
U should use velocity
local function CreateSpinningPart(part : BasePart,AngularVelocity : Vector3,Position : Vector3)
Position = Position or part.Position
AngularVelocity = AngularVelocity or Vector3.new(0,10,0)
local TerrainAtt = Instance.new("Attachment",workspace.Terrain)
TerrainAtt.WorldPosition = Position
local PartAtt =Instance.new("Attachment",part)
local AP = Instance.new("AlignPosition",part)
AP.Attachment0 = PartAtt
AP.Attachment1 = TerrainAtt
AP.MaxForce = math.huge
local AV = Instance.new("AngularVelocity",part)
AV.Attachment0 = PartAtt
AV.MaxTorque = math.huge
AV.AngularVelocity = AngularVelocity
end
CreateSpinningPart(workspace.Part)
Here is a one with better Orientation handeling
local function CreateSpinningPartNew(part : BasePart,AngularVelocity : Vector3,Position : Vector3)
Position = Position or part.Position
AngularVelocity = AngularVelocity or Vector3.new(0,.1,0)
AngularVelocity = CFrame.Angles(AngularVelocity.X,AngularVelocity.Y,AngularVelocity.Z)
local TerrainAtt = Instance.new("Attachment",workspace.Terrain)
TerrainAtt.WorldPosition = Position
local PartAtt = Instance.new("Attachment",part)
local AP = Instance.new("AlignPosition",part)
AP.Attachment0 = PartAtt
AP.Attachment1 = TerrainAtt
AP.MaxForce = math.huge
AP.Responsiveness = 200
local AO = Instance.new("AlignOrientation",part)
AO.Attachment0 = PartAtt
AO.Mode = Enum.OrientationAlignmentMode.OneAttachment
AO.MaxTorque = math.huge
AO.CFrame = part.CFrame
AO.Responsiveness = 200
AO.Enabled = false
game:GetService("RunService").Heartbeat:Connect(function()
AO.CFrame *= AngularVelocity
end)
AO.Enabled = true
end
As stated, Anchored parts that are CFramed or Tweened don’t actually move physically.
Try a HingeConstraint with its ActuatorType set to Motor, then make sure you have the settings in the HingeConstraint MotorMaxTorque and AngularVelocity configured to make the Part rotate how you want it.
Look in my models for a platform model (I’m not on Roblox right now) that I built for another person as an example.
It uses a PrismaticConstraint to do exactly what you want.
Hey, I just released a YouTube video that answers how to keep players on a part that moves back and forth in case anyone clicks on this thread looking for that