Character.PrimaryPart is only tweening and not tweening the entire character

local char = player.Character or player.CharacterAdded:Wait()

local tweenInfo = TweenInfo.new(
				2,
				Enum.EasingStyle.Sine,
				Enum.EasingDirection.In,
				0,
				false,
				0)
			
			local goals = {
				Position = part.Position
			}

			local goTopart = tweenService:Create(char.PrimaryPart,tweenInfo,goals)
			goTopart:Play()

I don’t know if this is a coding error or a studio bug or something else entirely.

2 Likes

Not sure if this is ur issue but I would tween the Humanoid root part (which is the primary part), i think that PrimaryPart is deprecated

Still doesn’t work I’ve tried it thanks for your help though

have you anchored ur character or something?

Hey! You could maybe use this it could work
for i=1, howManyTimesYouWantToLoop do
task.wait()
print(i)
primaryPart:PivotTo(primaryPart:GetPivot() + Vector3.new(YOUR VALUES HERE))
end

When you tween character.PrimaryPart it tweens only the humanoidRootPart or whatever primaryPart you set make the primaryPart visible and you will see only the primary part moves. Use instead PivotTo() like i showed it’s the same thing as GetPrimaryPartCFrame

How would I use that in a Tween parameter?

no it normally tweens the while character it’s probably because he’s using Position and not CFrame

It’s not a tween irs a whole different way to do it what he said

You should tween a Vector3Value and bind RenderStepped to teleport your character to the value of the Vector3Value. When completed, just disconnect the RenderStepped connection.

Maybe but Im trying to tween it, that won’t be possible I think

Yeah I know, but you can’t just tween a model, you gotta do it that way

dev

I think its because the HumanoidRootPart isn’t rigged

I think there’s supposed to be motor6ds or something

I don’t know to disconnect functions and bind functions its something I’ve been having trouble with.

I think your issue has something to do with how Roblox treats .Position and .CFrame changes differently. Let’s say you have Part1 with Part2 weld to it. If you change Part1’s Position, Part2 won’t move. However, if you changed Part1’s CFrame instead, Part2 would get dragged along for the ride. All of that being said, try tweening the character’s PrimaryPart by its CFrame instead of its Position.

Try this:

local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")

local tweenInfo = TweenInfo.new(
2,
Enum.EasingStyle.Sine,	Enum.EasingDirection.In,
0,
false,
0)
			
local goals = {
	Value = part.CFrame
}

local value = Instance.new("CFrameValue")
value.Value = char:GetPivot()

local goTopart = tweenService:Create(value,tweenInfo,goals)
goTopart:Play()
hrp.Anchored = true

local connection = game:GetService("RenderStepped"):Connect(function()
char:PivotTo(value.Value)
end)

goTopart.Completed:Connect(function() connection:Disconnect() hrp.Anchored = false end)
1 Like

Thank you, that worked and I learned a little extra today.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.