Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

{[HELP]} Rotating on a single axis?

Asked by 8 years ago

I'm trying to make a script that makes a part face another part while only rotating along the Y axis. I've already tried doing this but have had no success. I know it is possible because I've seem it done in other games. Does anyone know how this is done?

This script got me closest to what I wanted-->

--[[
Having one part in the workspace called "TargetPart" while having another also in the workspace called "TrackPart". Both parts are anchored. This script belongs in "TrackPart". Proceed to move "TargetPart" around while playing solo.
]]--

local stepped = game:GetService('RunService').Stepped

while stepped:wait() do
script.Parent.CFrame = CFrame.new(script.Parent.Position,Vector3.new(0,0,game.Workspace.TargetPart.Position.Z))
end

Answer this question