Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Tween not moving model when tweening primary part?

I am trying to move a projectile model by tweening the primary part but instead of moving the whole model it just moves the primary part.

	local direction = (tip.Position - hit.p).Magnitude
	
	local spellObject = game:GetService("ReplicatedStorage"):WaitForChild("WandModel"):Clone()
	spellObject.Parent = workspace
	spellObject:SetPrimaryPartCFrame(CFrame.new(tip.Position, hit.p))
	
	-- Fire spellObject in direction of mouse
	local tweenInfo = TweenInfo.new(
		direction * SPEED,
		Enum.EasingStyle.Linear,
		Enum.EasingDirection.Out,
		0,
		false,
		0
	)
	
	local goal = {
		CFrame = hit
	}
	
	local tween = TweenService:Create(spellObject.PrimaryPart, tweenInfo, goal)
	tween:Play()
	
	-- Damage a player when the spell object hits them
	-- and then destroy the object
	connection = spellObject.PrimaryPart.Touched:Connect(function(hit)
		local humanoid = hit.Parent:FindFirstChild("Humanoid")
		if humanoid and humanoid.Parent.Name ~= player.Name then
			humanoid:TakeDamage(DAMAGE)
			spellObject:Destroy()
			
			connection:Disconnect()
		end
	end)

1 answer

Try to ungroup and put it in a folder if it works comment down below

This discussion is preserved as it was. New answers, comments, and votes are closed.