Hey guys, What’s the best way to make a moving, Part, for example a moving platform, without the character sliding off?, i had this issue and i was using tweenservice, someone told me to use AssignPosition and Orientation, But i have no clue on how, if anyone can help it would mean alot!
1 Like
type this script into “Move”
local TweenService = game:GetService("TweenService")
local tI = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
local to = {
goEnd = {
CFrame = CFrame.new(script.Parent.Parent.End_Pos.Position)
},
goStart = {
CFrame = CFrame.new(script.Parent.Parent.Start_Pos.Position)
}
}
while wait() do
if script.Parent.CFrame == CFrame.new(script.Parent.Parent.Start_Pos.Position) then
wait(5)
TweenService:Create(script.Parent,tI,to.goEnd):Play()
elseif script.Parent.CFrame == CFrame.new(script.Parent.Parent.End_Pos.Position) then
wait(5)
TweenService:Create(script.Parent,tI,to.goStart):Play()
end
end
Type this script into “runservice”
local rService = game:GetService("RunService")
local lastPosition = script.Parent.Position
rService.Stepped:Connect(function(t,deltaTime)
local currentPosition = script.Parent.Position
local deltaPosition = currentPosition - lastPosition
script.Parent.AssemblyLinearVelocity = deltaPosition / deltaTime
lastPosition = currentPosition
end)
your character won’t slide off.
also the parts must be the same size
wait i thought they had a built in mechanic where you dont slide off
They’re finally implementing one, it works and it’s out now, but it’s still in beta as far as I’m aware (could be wrong).
1 Like