How did this game get his head to follow the mouse on the Y axis (as in looking up or down and not left or right)
(Game Link = "http://www.roblox.com/games/15110690/Zombie-Defense-Tycoon")
I attempted it but my one moves in ALL directions which I don't want it to, I want it to only work on the Y axis, when the player looks up and down.
utl.USI.InputChanged:connect(function(input) if (input.UserInputType == Enum.UserInputType.MouseMovement) then weld.C1 = CFrame.new(char.Head.CFrame.p,mouse.Hit.p):toObjectSpace(char.Torso.CFrame) end end
I have answered this type of question before, you can find my answer here.
While it may be for moving arms with the mouse in an FPS, the script basically moves the neck around so it simulates movement on the Y axis of the head.
Hope this helps you.
Hm, I'm not very familiar with CFrames, but you might want to isolate the Y coord in the welds.
Maybe instead of char.Head.CFrame.p
and mouse.Hit.p
you could to something like char.Head.CFrame.y
and mouse.Hit.y
?
Not entire familiar with CFrames, but you can do that. You may want to also explicitly state the X and Z coords, to keep the head from turning left, right, and diagonally...