If I create a part, add the script below as a child of that part, and Run the game without that part being anchored, it will print “hit” when the part touches something (which is what I expect).
However, if I spawn the part the script will be ignored entirely and it will not print “hit” when touched or perform anything else inside the function.
This is how I am spawning the part:
local toClone = game.ReplicatedStorage.Cloneables.ProjectileGG05
local newClone = toClone:Clone()
newClone.Parent = game.Workspace
newClone.Position = tool.Handle.Position
I am trying to make a cannon that fires a projectile which explodes upon impact, but it does not work because I must spawn the cannon ball, and that seems to make the script no longer work. I have also tried spawning the part and then cloning the script into that part afterwards, but it does not work that way either.
Can anybody help please?
Thank you very much!