trying to move a brick to the mouse position
the local part is specified to a part in workspace
part.CFrame = Mouse.Hit.p
the out put is that it expected cframe and got vector3, how do I fix this?
Error is pretty self explanatory. You are trying to assign the CFrame
property directly to a Vector3 which isn't allowed. You can either just set the CFrame to Mouse.Hit
or construct a CFrame our of the position.
Part.CFrame = Mouse.Hit --// or \\-- Part.CFrame = CFrame.new(Mouse.Hit.Position) --// don't use .p, use .Position
Convert Vector3 to cFrame:
part.CFrame = CFrame.new(Mouse.Hit.p.X, Mouse.Hit.p.Y, Mouse.Hit.p.Z)
I think this would work but I am not sure. I did this before with a Vector3
value from a part's position. Hope this helps!