TweenService Vector3 position with a variable

I’m trying to tween a part in a specific position using a variable, but when I use a print for see the position, I always receive 0,0,0

local ts = game:GetService("TweenService")

game.ReplicatedStorage.Disparo.OnServerEvent:Connect(function(player, pos)
	local cloneBullet = game.ReplicatedStorage.Bullet:Clone()
	cloneBullet.Parent = game.Workspace
	cloneBullet.Position = game.Workspace[player.Name].HumanoidRootPart.Position
	
	local tInfo = TweenInfo.new(0.2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
	
	local goal = {
		
		Position = Vector3.new(pos)
	}
	
	local tween = ts:Create(cloneBullet,tInfo, goal)
	tween:Play()
end)
1 Like

Print the “pos” argument at the very start of the remote event and before the event is fired on the client. Tell us what you get.

I have put 3 print. One in the localscript before firing the event, and two in the script. The first at the beginning print(pos) and the second at the end print(goal).

This is the result:
Captura

1 Like

change
Position = Vector3.new(pos)
to
Position = pos

This would probably fix it, if not let me know. Sorry that I can’t put it in Lua format, I’m currently on mobile.

4 Likes