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.
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.