Hi people can someone help me?
I got a moving platform using physics and i want to make a inertia for it so once i jump i dont get off the platform. I saw on forums that jailbreak train system post and tried to replicate that. It worked very well for tweening parts but bugs out for physics based movers.
I adjusted the code a bit to work better but there still some problems that happens. The code is:
if hitResult then
--checks if the player is jumping, falling down, climbing or in free fall
if humanoidState[humanoid:GetState()] then
if not lastPlatformCf then
lastPlatformCf = platform.CFrame
end
local relCf = platform.CFrame * lastPlatformCf:Inverse()
lastPlatformCf = platform.CFrame -- update the lastPlatformCf
rootPart.CFrame = relCf * rootPart.CFrame
else
--resets if the localplayer is not jumping
lastPlatformCf = nil
end
else
--resets if the localplayer is not in the platform
lastPlatformCf = nil
end
Roblox handles the contact and the code runs only when player jumps, it works when the platform is in low/normal speed, whoever it bugs out and push the player foward at high speed.
if someone can help me out with this i appreciate.
Here both videos at normal and high speed
** You are now Level 1! **