Objects position not being set to Characters Torso

Hello, I made a script that uses tweening to set a parts position, but when the walks or jumps away(even when jumpower is set to 0 and the character gets anchored with a wait after that) the shard isn’t perfectly set to the players Torso.

Effect when player moves
https://gyazo.com/165c939c346d10e5ad3b662595b8d878
desired effect
https://gyazo.com/eb3cd4fb5f7a8a16478265aec084d63a
script

tween = game:GetService("TweenService")
script.Shard.OnServerEvent:Connect(function(plr)
	shard = game.ReplicatedStorage.TOOLS.ShardCoffin:Clone()
	char = plr.Character
	hm = char.Parent:FindFirstChild("Humanoid")
	char.Humanoid.JumpPower = 0
	wait(.5)
	char.Torso.Anchored = true
	wait(.5)
	shard.CFrame = char["Left Leg"].CFrame * CFrame.new(0,.5,0)
	shard.CFrame = shard.CFrame * CFrame.Angles(0,0,3)
		tweeninfo = TweenInfo.new(
			2,
			Enum.EasingStyle.Sine,
			Enum.EasingDirection.Out,
			0,
			false,
			0			
			
		)
		
		partproperties = {
			Size = Vector3.new(20,20,20),
			Position = char.Torso.Position
			
		}
	shard.Parent = game.Workspace
	tween1 = tween:Create(shard,tweeninfo,partproperties)
	tween1:Play()
end)
1 Like

Have you tried checking to see how it goes on the server side in Studio? I find that things like this can happen often because of latency on the client.

If it does look fine on the server side, I would recommend you go about doing this in a different way with something called RenderStepped. You can use it to make sure the crystal is always set to be in the middle of your character every frame as well as have it grow to your desired size little by little per frame. Using RenderStepped will make absolutely sure that the crystal is where it needs to be.

1 Like

What would that look like? (I’ve never used renderstepped)

Have you tried using HumanoidRootPart?

Using HumanoidRootPart has the same problem.

?, I’m still looking for a solution.

Hm… It looks like you are making the shard apart of the Workspace… Maybe you could set it to being inside of the character?
Another option could be, you set the parent to leftleg, then once it is spawned in, you can tween it as you’d like. I’ve never used renderstepped either.

It worked fine thanks! :grinning:

1 Like

No problem! This is my first solution lol

Anyway, was it the parenting of the character or my 2nd option? I ask because I am curious and might try this character effect myself!

It worked after I parented to the Left leg.

1 Like