So I'm experimenting with The Mouse 'Hit' (the CFrame of where the mouse is), and I"m trying to make this one part move by changing the property 'position' in BodyPosition in the block.
I don't know how I can get the CFrame information and put it into a Vector3 format for the 'position' property of BodyPosition
This is the script
local player = game.Players.LocalPlayer local mouse = player:GetMouse() --Getting the player's mouse local move = game.Workspace.Move mouse.Move:connect(function() --When the mouse moves while true do wait() local target = mouse.Hit if target == nil then return end move.BodyPosition.position = Vector3.new(target) end end)
Very simply, the position
portion (a Vector3) is stored in the p
property of CFrame objects!
In line 11 there, replace Vector3.new(target)
with target.p
!
Remember, the p
is lowercase. Lua is case-sensitive.