[HELP!] - Attatch to HumanoidRootPart Script

How do I script my hover for it to attatch to my humanoidRootPart when the game starts.?

image

1 Like

You could use a RigidConstraint to connect the hoverboard attachment to the RootRigAttachment but you will have to move the hoverboard’s attachment upwards until you get a nice offset. Feel free to experiment with positions and dummy humanoids to find the right height.

2 Likes

I welded it but i get stuck

image

Here is the code:

local EquipEvent = game.ReplicatedStorage.Events.VehicleEquip
local runser = game:GetService(“RunService”)

EquipEvent.OnServerEvent:Connect(function(player, hover)

local physicalplayer = game.Workspace:WaitForChild(player.Name)
print(hover.Name)
hover.Parent = physicalplayer
	
hover:SetPrimaryPartCFrame(physicalplayer.RightUpperLeg.CFrame)

local weld = Instance.new("WeldConstraint",hover.PrimaryPart)
weld.Part0 = physicalplayer.RightUpperLeg
weld.Part1 = hover.PrimaryPart

end)

Make sure the hoverboard isn’t anchored, and weld every part inside the board to the board part that gets welded to the HumanoidRootPart.
Also make sure it gets offset downwards to make it look like the player is standing on it.

I did it, but it is shaking. When I delete the wheels’ weld doesn’t shake anymore.

Try using a RigidConstraint instead, as colbert mentioned

I dont know how it works… Why is weld bad for this?

Weld is bad for this because when your animation is playing, it will shake with the tempo of the animation. Not sure how rigidconstraint would fix this though lol.

A method you could theoretically use is to make a seat on the hoverboard, then play an animation when the player sits on it so it doesn’t actually look like they are sitting on it (if you get what I mean). But in that case you would have to figure out vehicle mechanics…

Ohhhh ok I just thought of something. Reset the walk animation of the player so it doesn’t actually play anything. Next, Weld the hoverboard to the players humanoidrootpart, then change the HipHeight of the Humanoid to match the position of the hoverboard.

My idea is to make the hover follow the player while the wheels are rotating. Meanwhile, an animation will be playing. I want the player to stick in the vehicle forever.

Then use my second idea. I can try to make a test version.

What is HipHeight property?

Make sure all the parts in the hoverboard have “cancollide” equal to false. If they aren’t equal to false then it will act as if you are constantly grinding against the hoverboard.

The HipHeight property just lifts the player up (It is normally for custom characters but it can create pretty cool effects too)

(I’m creating a testing place I’ll send the link once I finish)

CanCollide is off on all parts

Where can i find the HipHeight property?

Then there should be no problem, this includes unions and meshparts as well. If any part of it has cancollide on it will continue to shake.

It is part of the Humanoid (Humanoid.HipHeight = blah blah blah).