i made this script with the help of youtube but the script is only for horizontal movement, i made the Finish part and Start part be different levels of height. this makes it do: from start it goes up, then it moves to finish, then it goes down. moves to start instead of slowly going up and moving to the next part.
local SPEED = 10;
local start = script.parent:WaitForChild("Start");
local finish = script.Parent:WaitForChild("Finish");
local attach0 = Instance.new("Attachment");
attach0.CFrame = CFrame.new();
attach0.Parent = script.Parent;
local attach1 = Instance.new("Attachment");
attach1.CFrame = finish.CFrame;
attach1.Parent = game.Workspace.Terrain;
local pris = Instance.new("PrismaticConstraint");
pris.ActuatorType = Enum.ActuatorType.Motor;
pris.MotorMaxForce = math.huge;
pris.Attachment0 = attach1;
pris.Attachment1 = attach0;
pris.Parent = script.parent;
local forward = true;
pris.Velocity = SPEED;
attach1.CFrame = finish.CFrame
start.Touched:Connect(function(hit)
if (hit == script.Parent and not forward) then
forward = true;
pris.Velocity = SPEED;
attach1.CFrame = finish.CFrame
end
end)
finish.Touched:Connect(function(hit)
if (hit == script.Parent and forward) then
forward = false;
pris.Velocity = -SPEED;
attach1.CFrame = start.CFrame
end
end)
I am absolutely confused on what you’re trying to do here. It seems like you’re trying to move a part between two locations.
local Platform = workspace.Platform -- Your platform
shared.TweenService = game:GetService'TweenService'
local StartingPosition, EndingPosition = Vector3.new(0,0,0), Vector3.new(10,10,10) -- where to start and end
Platform.Position = StartingPosition
shared.TweenService:Create(Platform,
TweenInfo.new(5, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, -1, true), {
Position = EndingPosition
}
):Play() -- This will go back and forth every 5 seconds.
the script from original post works fine, the problem is this: https://gyazo.com/0be60d665bc4fc5fb2acf273f213de11
it doesnt smoothly go from one to another, it goes down or up first making it hard to stand on
and btw the locations are: MovingPart has 3 things in it: Finish, Start and a script
its supossed to diagonally go to the next part
Maybe just add a tween thingy to my script? Maybe that will work, instead of locations to know where to go to and stuff I use a Start and Finish part where the platform goes to
this gave me a solution to not sliding off (currently having errors but i created a new topic for that) but still no solution for the moving platform itself, i used @Warriorfoox 's script which worked just now but the platform doesnt really move smoothly, 1: it goes slow and then super fast to reach the destination which causes the player to slide off even with the jailbreak script and 2: it moves in pieces (it stutters) and not smoothly.