What do you want to achieve? Keep it simple and clear!
I want the player to stay on the hand when moving and not sink and fall
What is the issue? Player is sinking through hand as seen in this video
What solutions have you tried so far? Ive tried changing to a while loop and switched to renderstep
Here Is the Code for the platform
Function = RunService.RenderStepped:Connect(function()
local RootPart = Player.Character.LowerTorso
local Ignore = Player.Character
local ray = Ray.new(RootPart.CFrame.p,Vector3.new(0,-50,0))
local Hit, Position, Normal, Material = workspace:FindPartOnRay(ray,Ignore)
if Hit and Hit.Parent:FindFirstChild('Palm') or Hit.Parent.Parent.Parent:FindFirstChild('Palm') then
if Hit.Parent:FindFirstChild("Palm") then
Hit1 = Hit.Parent
else
Hit1 = Hit.Parent.Parent.Parent
end
print(Hit)
local Platform = Hit1
if LastCFrame == nil then
LastCFrame = Platform.Palm.CFrame
end
local PlatformCF = Platform.Palm.CFrame
local Rel = PlatformCF * LastCFrame:inverse()
LastCFrame = Platform.Palm.CFrame
RootPart.CFrame = Rel * RootPart.CFrame
else
LastCFrame = nil
end
Function2 = Player.Character.Humanoid.Died:Connect(function()
Function:Disconnect()
Function2:Disconnect()
end)
end)
``` This is my first post so sorry if I did anything wrong
@Q4_42 I don’t believe/think that would fix the issue? I might be wrong though
However, I do believe the issue is that since the object is moving at a very fast pace, since Roblox works (if I’m right) from the frames of the game/framerate with physics/etc.
Think of it as pictures on the screen, if you have high fps, you would of course have more frames/smoother/more visiblity.
Now if you had less frames, it would seem like its teleporting resulting in stuttery issues.
This is probably is whats happening, its not lag, but its probably fast velocity.
You may be able to fix this by temporarily increasing the raycast distance from top to bottom when the hand begins to change posistion rapidy (you can detect the difference in position by subtracting/other methods).
This in turn will allow your script to work with it while still catching up. Of course, this method is somewhat hacky I guess?
Last method I can think of is to move the humanoid relative to the character on the palm’s position.
Until of course you’re certain the raycast is hitting nothing but air/another part.