Tween player together with truck?

I have a truck that I tweened in location, and I want to make sure that the players that were on the truck stay on the truck.
When the truck tween starts, obviously the player falls off and stays in the same spot.
I have tried welding seats to the truck but that doesn’t help, how do i make sure that i tween the players standing on the truck together with the truck?

Also tween the players? You would have to wait until the truck has started the tweening and tween the players at the same pace

1 Like

How would I tween the players? Using HumanoidRootPart?

1 Like

Most likely, as HumanoidRootPart is the root of the plr

How would I define HumanoidRootPart? I tried the following:

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local HumanoidRootPart = player.HumanoidRootPart

but it always resulted into a nil value… What am I doing wrong?

1 Like

You could try welding the player to the part. You could also use CFrame as well. This might help. Of course you would need to do your casual tweenservice.

Alright I’ll take a look, I’ll tell you later if it worked :slight_smile:

1 Like

You could try and create a system that duplicates the player, and bind it to the truck using model. Then have the tween bind to the model, so it isn’t just client side. Or use bodygryo i would think.

To Get The HumanoidRootPart Do It Like This

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local HumanoidRootPart = char.HumanoidRootPart
1 Like

You add the trucks velocity to the players Velocity. So if the truck is moving the player will move as well.

So if the truck is moving at a rate of (0,0,30).
Player.Velocity = Player.Velocity + Truck.Velocity

The reason we add it onto the players current velocity is so that the player can walk around the truck. If we were to just set the players velocity to the trucks velocity the player would be unable to move once in a truck.

2 Likes

Thank you! this really helped! :slight_smile:

1 Like