It sounded simple to me, but I couldent understand it. I want to make a player move along with a moving part whenever the player is ontop of it.
I looked at other solutions, but it looks like theres just so many solutions for diffrent purposes, and it looks very complex. Im very stuck on where to even start.
I only want the player to stick on the part while standing on it, when they jump they should stop sticking
If anyone wonders what my current script is, its just a basic moving script with waypoints:
local t=script.Parent.Time.Value
local Tween_Settings = TweenInfo.new(t,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,-1,true)
local WP1 = script.Parent:WaitForChild("Waypoint1")
local WP2 = script.Parent:WaitForChild("Waypoint2")
local MP = script.Parent:WaitForChild("Moving")
WP1.Transparency = 1
WP2.Transparency = 1
MP.Position = WP1.Position
local TS = game:GetService("TweenService")
TS:Create(MP,Tween_Settings,{Position=WP2.Position}):Play()
I was actually having the same problem as you somewhere around a week ago. After searching for longer than 10 seconds, I decided to use AlignPosition.
AlignPosition moves your character using Roblox physics, as if you just set the CFrame, it won’t interact with the character. You can just drop it in into the properties table of TweenService:Create()after creating the attachments when the character gets added.
Alright I’ll try this soon but just to make sure i understand it, I connect with the players root attachment (or whatever it’s called I forgot) to the align position when it touches the part. Then I disconnect the attachment once it stops touching the part.
Basically, AlignPosition interacts with physics. That means moving the character, and being forced to move around parts.
This following video is what I mean using my implementation of the moving platforms (the system’s kinda like yours). The video’s fast because Roblox didn’t like me uploading something longer.
To fix it, you’d have to create a collision group for the moving platform and disable collisions with all other collision groups shown in the Collision Groups Editor, and create a new collision group for all the parts in a character every time Player.CharacterAdded is fired.