i want a part to rotate to cursor via Orientation; no CFrame witchcraft. can anybody help me with this?
COMMUNITY QUESTION
make part rotate to cursor?
1 answer
Eh, you need some CFrame witchcraft. But it's fairly simple to do!
One of the constructors of a CFrame is as follows:
CFrame.new ( Vector3 Position, Vector3 LookAt )
For example:
CFrame.new(Vector3.new(0, 10, 0), Vector3.new(5, 0, 0))
Will create a CFrame located at {0, 10, 0}, oriented towards {5, 0, 0}. And that's all! Now all that's left is to plug in what you know already:
-- Local script
local mouse = game.Players.LocalPlayer:GetMouse()
local part = workspace.Part
mouse.Move:Connect(function()
part.CFrame = CFrame.new(part.Position,mouse.Hit.Position)
end)
Hope I helped!
This discussion is preserved as it was. New answers, comments, and votes are closed.

10 comments
well
ok
well i need the orientation mainly for the fact that im doing a CFrame free game but thanks anyways
accept the answer plox
im sorry dude
but it needs to b without cframe
U simply cant.
Would you rather make an algorithm to point a rotation vector at a position vector? I don't think so.
CFrame.new(pos, look)is as easy as it gets.actually yes
its not for performance or anyting its a personal challenge. if u dmonstrate what u said ill accept it