i have a custom rig,
player can move this rig with WASD,
the rig is always facing forward when moving,
for example; when you press D, character moves right, but it is facing forward like you pressed W
so i wanna achieve: the character looking where it is moving
BUT i wanna achieve it in the way i already have done it so i dont have to fix my scripts, currently the character is always facing towards a part called “Target” so i wanna know ; how can i position this “Target” part the way the chaacter is moving.
example; if the character is moving right by holding D, then the “Target” should be positioned 5 studs away to the right from character root part, and it should be relative tot he world position but not the humanoid root part, because when the humanoid root part turns right then the “right” would also move right, we dont want that.
i know how to get the player move direction, but idk how to position a part at that direction, bc its just a vector
this is what i tried last (i tried other stuff too); script.Parent.Target.Position *= script.Parent.HumanoidRootPart.Position + (script.Parent.Humanoid.MoveDirection * 5)
but ofc im doing it wrong
thanks for replying so fast, but i just found it right after posting
if script.Parent.Humanoid.MoveDirection ~= Vector3.new(0,0,0) then
script.Parent.Target.Position = script.Parent.HumanoidRootPart.Position + (script.Parent.Humanoid.MoveDirection * 30)
end
take the position of the player’s rig, and add onto it the player’s move direction multiplied by a bit, then set the result position as the target’s CFrame