I want to make a skateboard spawning script that when ever you click the skateboard spawns where your mouse is, but I also want it to face the direction from my torso to the mouse. But how??
I believed that this involves in .unit and something with CFrame.new(position, position)
I believe something like this might work:
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.Button1Up:Connect(function() local board = --set to skateboard part local direction = (mouse.Hit.p-plr.Character.HumanoidRootPart.Position).unit direction = direction * Vector3.new(1,0,1) --keep line if you only want rotation on y axis board.CFrame = CFrame.new(mouse.Hit.p,mouse.Hit.p + direction) end)
Keep in mind if the game is FilteringEnabled you will have to use RemoteEvents to create the skateboard.