I'm having trouble using PrimaryPart to move a model

I’m trying to make a projectile appear and fly forwards. The projectile is a model, and I have tried to use the PrimaryPart feature to move the entire model, but only the PrimaryPart is moving/appearing, and not the rest of the model. I can tell I’m definitely doing something wrong, but as I am unfamiliar with the topic, I’m having trouble fixing it.


Video of what happens.

image

Versus the full model that is supposed to appear.

I’ve looked through many pages of the developer api website, and countless devforum posts, none of which seem to help me.

local fireslash = game.ServerStorage["Breath Skills"]:WaitForChild("fireslash")
fireslash.PrimaryPart = fireslash.fireslash3

local damage = 10

game.ReplicatedStorage.Remotes.Fireslash.OnServerEvent:Connect(function(player, CFrame)
	local character = player.Character
	local newSkill = fireslash.PrimaryPart:Clone()
	newSkill.CFrame = character.HumanoidRootPart.CFrame
	local bv = Instance.new("BodyVelocity")
	bv.MaxForce = Vector3.new(6000,6000,6000)
	bv.Velocity = (character.HumanoidRootPart.CFrame.lookVector*150)
	bv.Parent = newSkill
	local playerposition = character.HumanoidRootPart.Position
	newSkill.Parent = workspace
	local skillHit = newSkill.Touched:Connect(function(hit)
		if hit.Parent:FindFirstChild("Humanoid") then
			if hit.Parent.Name ~= player.Name then
				hit.Parent.Humanoid:TakeDamage(damage)
			end
		end
	end)
	while wait(0.5) do
		local distance = (playerposition - newSkill.position).magnitude
		if distance > 1 then
			newSkill:Destroy()
		end
	end
	wait(0.5)
	if skillHit ~= nil then
		skillHit:Disconnect()
	end
	newSkill:Destroy()
end)

I am fairly new to scripting, so none of it really made sense to me. As a final resort, I have come here, to see if anyone can explain what I’ve been doing wrong, and what I can do to fix it.

You’re only cloning the primary part rather than the full model, you need to clone the full thing then get a reference to the clones primary part to move the new model

1 Like
local newSkill = fireslash.PrimaryPart:Clone()

You are only cloning the primary part. I believe you should be doing this instead.

local newSkill = fireslash:Clone()

But because newSkill is now a model instead of a basepart, you would need to change the BV’s parent to newSkill.PrimaryPart and change newSkill.CFrame to…

newSkill:SetPrimaryPartCFrame(character.HumanoidRootPart.CFrame)

1 Like

I feel like an idiot now lol, but thanks! I’m saved!

No worries, we’ve all been there lol

1 Like