This is very basic and I’m planning to use a local moving platform but first I want test it on server then move on to client and I used alignposition on platform to move with a character along. But it doesn’t carry a character but on YouTube say it’s supposed to carry a character. That’s what I’m struggling with.
local folder = script.Parent
local debounce = false
function MovePlatform(model)
local platform = model:FindFirstChild("Platform")
local Align = platform:WaitForChild("AlignPosition")
local startPos = model:FindFirstChild("A")
local endPos = model:FindFirstChild("B")
Align.Position = startPos.Position
startPos.Touched:Connect(function(hit)
if hit == platform and debounce == false then
debounce = true
task.wait(2)
Align.Position = endPos.Position
task.wait(2)
debounce = false
end
end)
endPos.Touched:Connect(function(hit)
if hit == platform and debounce == false then
debounce = true
task.wait(2)
Align.Position = startPos.Position
task.wait(2)
debounce = false
end
end)
end
for _, model in pairs(folder:GetChildren()) do
if model:IsA("Model") then
MovePlatform(model)
end
end
Is the platform’s CanCollide value set to true? If so, is it in the same collision group as the player?
Edit: wait, if you’re trying to control it from the client, you have to create the part using a local script. Maybe try cloning it into the workspace from ReplicatedStorage or somewhere when the player joins.
If the problem is that the platform isnt moving, maybe try setting the goal position of the platform before the function, or just type it into the alignposition manually so that it actually has a place to go initially.
If it’s already touching a goal point when the game starts, it’s not going to fire the Touched event to give it a new position.
Try setting RigidityEnabled to true. I’m just going to guess the platform is falling because the player is too heavy, and that’s the only other thing that’s sticking out to me.
found this 5 month later if you still have an issue. Try getting the mass of the players on it, and turning the Y value up so basically
local Mass = 0
local character = hit.Parent
for _,v in pairs(character:GetDescendants()) do
local additive = v:GetMass()
Mass += Additive
end
Align.Position = endPos.Position * Vector3.new(0,Mass,0)