I tried doing this but this didn't work
local placelocation = game.Workspace.Nets.Ballspawn.CFrame
Part.CFrame = CFrame.new(placelocation)
I tried doing this but this didn't work
local placelocation = game.Workspace.Nets.Ballspawn.CFrame
Part.CFrame = CFrame.new(placelocation)
The constructor CFrame.new() needs a Vector3 position for it to create a new CFrame. Your error is placing a CFrame inside of it which isn't a Vector3.
You do have methods for setting position and rotations like this:
local location = workspace.Ballspawn.CFrame --This is the CFrame only
--We get the first 3 values (POS values) of the CFrame like this
Part.CFrame = CFrame.new(location.Position) --Vector3 inside of a .new()
--We can also just stick with the variable since it's a CFrame
Part.CFrame = location --Setting a CFrame to a CFrame
The difference to both examples is that the first wont keep the rotation of the location you're setting it to. That's because a CFrame is a matrix with the position and a rotation for an object.
You could just set the Part's position instead to do the same.
Note that the first 3 values to a CFrame are the (X, Y, Z) coordinates or the position of the CFrame
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
are you trying to move a part or model?