How to tween an object

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear! How do I tween a bullet out of a turret

  2. What is the issue? Include screenshots / videos if possible! so i have a bullet that i clone from replicated storage and parent to workspace. and when it click a person i want it to tween to his torso and i want him to take damage the damage part is done but the bullet wont tween

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub? yes

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Heres an image of what happens when i try to tween it
image - the yellow thing is the bullet

below is the code i used to tween the bullet

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("IDK FOR NOW") -- remote event dont ask about the name
local TweenPart = ReplicatedStorage:WaitForChild("Bullet")
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(
	1, 
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.In,
	0
)

local function damage(player, humanoid)
	local TweenGoals = {
		Position = humanoid.Torso.Position; 
        }
	print(humanoid.Torso.Position)
	print(player.Name.." Fired event")
	humanoid.Health -= 1
	local bullet = TweenPart:Clone()
	bullet.Anchored = true
	bullet.Parent = game.Workspace
	bullet.Position = game.Workspace.Nozzle.Position
	local Tween = TweenService:Create(TweenPart,Info,TweenGoals)
	Tween:Play()
	wait(1)
	bullet:Destroy()
end

remoteEvent.OnServerEvent:Connect(damage)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

I wouldnt tween it if i were you, since if the distance varied, the bullet would be going at very different rates. I would just move the bullet using a repeat until loop

Seems to me like you want to call TweenService:Create on bullet not TweenPart

Oh my what a silly mistake I made! although that fixed it, the tween still doesnt hit the person its seems way off…
robloxapp-20220904-1730105.wmv (349.2 KB)

using repeat loops for a shooting system will decrease the performance of my game a lot

heres the new script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("IDK FOR NOW")
local TweenPart = ReplicatedStorage:WaitForChild("Bullet")
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(
	1, 
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.In,
	0
)

local function damage(player, humanoid)
	local TweenGoals = {
		Position = humanoid.Torso.Position;
		}
	print(humanoid.Torso.Position)
	print(player.Name.." Fired event")
	humanoid.Health -= 1
	local bullet = TweenPart:Clone()
	bullet.Anchored = true
	bullet.Parent = game.Workspace
	bullet.Position = game.Workspace.Nozzle.Position
	local Tween = TweenService:Create(bullet,Info,{Position = Vector3.new(0, 30, 0)})
	Tween:Play()
	wait(1)
	bullet:Destroy()
end

remoteEvent.OnServerEvent:Connect(damage)

I have fixed it myself thanks guys