I’m making a project zomboid game and I was wondering, how could I make a players character move in the direction their character is facing?
As you see, the player faces wherever the mouse is, but I also want the body to move in the direction it’s facing because it looks weird if it isn’t like that.
--parent to starterplayerscripts
local Event
Event = game:GetService("RunService").RenderStepped:Connect(function()
if game.Players.LocalPlayer.Character then
game.Players.LocalPlayer.Character.Humanoid:MoveTo(game.Players.LocalPlayer:GetMouse().Hit.p)
end
end)
--Event:Disconnect()
Yea this works but it is not what I’m trying to do.
When they press the W key to move forward obviously, I want them to move in the direction they’re facing. Same goes for pressing the S key, they’ll mvoe backgrounds in opposite direction they’re facing.
Are you trying to make the body face and move in the direction of wherever they’re walking rather than following the mouse, while the head follows where the mouse is?