AlignPosition is not working?

What do I want to achieve and what is the issues?

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.

https://gyazo.com/868bb2d16ed6206d4c50db2fa10c1569

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

How I do make it carry a character?

1 Like

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.

1 Like

Yes, It’s CanCollide is set to true and collision group is default.

Yeah, I’ll do client but I just want do test server first.

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.

No, the platform is moving but it won’t carry a character.

What do you mean? Is the character falling through it?

No. Platform is CanCollide true. Just the platform doesn’t carry a character when a character stand on platform.

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.

I tried that too. It didn’t carry a character too.

If turning up responsiveness doesn’t work, then I’m sorry for wasting your time and maybe somebody else can come up with an idea lmao

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)

Hey did you ever happen to fix the issue? I was having the same problem and I found out what was wrong with mine.