Moving Platform issue

I’ve been looking around on other posts, and none have really answered my question directly. I’ve made a working moving platform that goes to and back to the original starting point, but the problem is when I walk onto it, it doesn’t let me stay on it and I fall off.

yeahyeah


	local TweenService = game:GetService("TweenService")
	local TweenPart = script.Parent
	
	local TweenInformation = TweenInfo.new(
		
		18, 
		
		Enum.EasingStyle.Linear, 
		
		Enum.EasingDirection.In, 
		
		-1, 
		
		true, 
		
		3 
		
	)
	
	local posy = {
		
		Position = script.Parent.Position + Vector3.new(-211,0,0)
		
		
	}
	
	local onion = TweenService:Create(TweenPart, TweenInformation, posy)
	

	onion:Play()

I was wondering if anyone could help me figure out how to make my character come with the platform, instead of falling off once it moves.

Thanks :slight_smile:

3 Likes

You can use a touch event and move the character relative to the touched part

1 Like

oh ok, i’ll make an attempt of doing that

You should use body position instead, Because script doesn’t support physics

1 Like

Do you have any idea of how i could do that? Would i just need to put BodyPosition into the part?

yes, and then just casually set the position to the destination

oh okay, i’ll try that, thanks!

or you could use the script to create a new body position everytime they touched or clicked something

i’ve tried to move the BodyPosition but nothing happens



yuh = script.Parent.Parent

original = Vector3.new(-1982, 147.5, 550)


while true do
	script.Parent.BodyPosition.Position = yuh.End.Position
	wait(5)
	script.Parent.BodyPosition.Position = original
	wait(5)
end

i’m just a bit confused, do i only need bodyposition or do i need the tween too? and also i’d appreciate some help on making the “bodyposition” work

no you don’t need tween for it, and btw did u run? and is this a normal script or a local one?

it was a normal script yeah, is it meant to be local?

no, I guess I’ll test this one

oh okay, i appreciate your help so far! :slight_smile:

ah, you must unanchor the part

still doesn’t move for some reason even though it’s unanchored :L did you use my exact script?

wait, do you mean that the yuh part is the parent of that moving part?!?

so “yuh” is the model that they’re all in, and i just used that to save me from typing “script.Parent.Parent”

Screen Shot 2020-05-15 at 02.29.43

Make sure the part isn’t inside or blocked by any other parts.You might need to up the force on the BodyPosition if the brick is to heavy to be moved by the current force.

1 Like

Gonna guess that you’re using cframe and tweens (make sure the movement is mostly done on client while primary movements/things are done on server)

You can utilize this solution to help you “attach” the character to the platform.

I personally always use anchored bricks and cframes, I never trust unanchored things :man_shrugging: idk why. Probably because unanchored things are so easy to break at times :pensive:

1 Like

i tried to up the force a bit and move it around a little, but it just fell through the floor even though it was completely solid