I'm trying to make a cannon that will fire projectiles stored in ServerStorage
Whenever I try to call out the item, instead of cloning a freestanding object where the barrel of the Cannon is it just spawns in a freestanding object at the place in the Workspace it was before I moved it to Server Storage.
I need it to be able to be spawned at the "Barrel" point of Model named Cannon to the point where I can apply a vector force and the likes.
local storage = game.ServerStorage local cBall = storage.cannonBall:Clone() cBall.Parent = game.Workspace
Using this script below returns an error stating that** MoveTo is not a valid member of Part** on Line 4
local storage = game.ServerStorage local cBall = storage.cannonBall:Clone() cBall.Parent = game.Workspace cBall:MoveTo(game.Workspace.Cannon.Barrel.Position)
Is there a way to get past all of this, a correct way of doing it, or should I try the method along the lines of
cBall = Instance.new("Part") cBall.name = cannonBall
and so on that will spawn a new freestanding part at the barrel fresh?
Thanks for any help in advance!
~MBacon15
Well I don't think you use MoveTo
for parts. I would recommend CFrame or Position to move the part.
Use this to replace the cBall:MoveTo
cBall.CFrame = CFrame.new(game.Workspace.Cannon.Barrel.Position) --Moves the cannonball to where the barrel is.
Not sure if this works, since I'm not using studio .3.