Custom Character doesnt stay on moving part

I have a custom character, a sphere, which needs to move alongside a moving part. Currently, the moving part just moves by itself without bringing the custom character with it.

I’ve tried:

  • Setting the custom characters velocity to the moving parts velocity, but the moving part has a velocity of 0 for some reason (uses tweeting to move)
  • Updating the position of the character to the position of the moving part, which is not preferable as it interferes with the custom character’s scripts and isn’t the best for performance related stuff

Anyone got any ideas? Heres how the moving part works

local Part1 = Part:FindFirstChild("Part1")
local Part2 = Part:FindFirstChild("Part2")
local Time = Part:GetAttribute("Time")
if not Part1 or not Part2 or not Time then return end
		
Part.CFrame = Part1.CFrame
Part1.Transparency = 1; Part2.Transparency = 1;
		
local Info = TweenInfo.new(Time, Enum.EasingStyle.Linear, Enum.EasingDirection.In, math.huge, true)		
local Tween = TweenService:Create(Part, Info, {Position = Part2.Position})
Tween:Play()

-- move between Part1 and Part2, forever, in time seconds

1 Like

I’m pretty sure that’s normal physics behaviour. Try out some games where you’re a ball like this one and see how you act with moving parts.

I could be wrong though. Feel free to tell me!

So far my knowledge, tweening parts neglect physics. There is something made to accustom movements to align with other moving parts, but I wouldn’t know if it applies to custom characters.

Maybe it’s worth browsing through the entire topic, perchance you see some one with the same issue as you.


2 Likes

Does the AlignPosition object work then? Or is it the same issue?

1 Like

Although it looks possible, I can’t make sense of it due to my lack of experience using it. Perhaps you’re able to use Attachment0’s Vector3 goal position of the tween and apply it to the player as Attachment1, but then you’re still faced with allowing the player to move – or in this case – roll.

Still, a lot of the events and/or functions that the AlignPosition brings are force, thus physics-related, making me doubt it’s validity.

If I’m wrong (which could be the case) ForceRelativeTo: looks most plausible to me.

1 Like

It’s a physics based mover constraint so yes it will work.

1 Like