So I’m trying to make the entire players character tween to a part without bugging and its not working, any help? (its on a local script to reduce lag)
local hrp = game.Players.LocalPlayer.Character.HumanoidRootPart
local hum = game.Players.LocalPlayer.Character.Humanoid
local moveto = game.Workspace.RESET.UNIVERSE
local TweenService = game:GetService("TweenService")
local goal = {}
goal.Position = moveto.Position
local tweenInfo = TweenInfo.new(5)
local tween = TweenService:Create(hrp, tweenInfo, goal)
tween:Play()
hum.WalkSpeed = 0
hum.JumpPower = 0
game.Workspace.Gravity = 0
local things = game.Players.LocalPlayer.Character:GetDescendants()
for index, descendant in pairs(things) do
if descendant:IsA("BasePart") then
descendant.CanCollide = false
end
end
end)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
if character then
local part = game.workspace.Part -- part where you want the character to move.
character.Humanoid:MoveTo(part.Position)
end
I learnt recently that while using functions such as tween and body position you have to enable the platformstand option under the humanoid of a player, When you do that the default character script seems to NOT work and the player assumes a flying stance. I have not personally experimented with this (since it was not needed for me) , but i believe that’s how it’s done.
(Sorry for the vague info, if you have any more questions i would love to help!)
You can temporarily anchor the HumanoidRootPart. This will prevent the player from moving and also make your Tween work correctly. Just setup the properties dictionary to include CFrame with its destination set to where you’d like the Character to “float” to. If you want it to follow a path this isn’t just linear, you can put that process in a loop where you progress through a table of destinations. Remember to unanchor the HumanoidRootPart after the final Tween is complete (if you’d like the Player to be able to move again!)