Primary part not working?

I have a script that makes a impact crater spawn wherever a meteor lands, for some reason on the first hit it works fine but after that all the impacts just spawn in the same location as the first one. here is the script: script.Parent.Touched:Connect(function(hit)

local NewImpact = game.ReplicatedStorage.Impact:Clone()

NewImpact.Parent = workspace

NewImpact.PrimaryPart = NewImpact.MainPart

NewImpact.MainPart.CFrame = script.Parent.CFrame

script.Parent:Destroy()

end)

anyone know a fix?

You need to set the PrimaryPartCFrame instead of doing NewImpact.MainPart.CFrame = script.Parent.CFrame

Try doing this:
NewImpact:SetPrimaryPartCFrame(script.Parent.CFrame)

If that doesn’t work, then I have no clue what else to do

thanks, forgot that command was a thing.

1 Like

Just let me know if everything worked fine!

1 Like