I've tried moving a model to a specific position. However, the position is in Vector3. I used SetPrimaryPartCFrame but i dont know how to convert Vector3 in CFrame
Here is my script :
game.ReplicatedStorage.RemoteEvent.OnServerEvent:connect(function(player, mousePosition)
local model = game.Workspace.Model:Clone()
model.Parent = game.Workspace
model.PrimaryPart = spike.Part
print(mousePosition)
model:SetPrimaryPartCFrame(mousePosition) -- This doesnt work : it puts the model to the spawn position 0,0,0
end)
This part is from the LocalScript that fires the event :
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local mousePosition = mouse.Hit.p
game.ReplicatedStorage.RemoteEvent:FireServer(mousePosition)
