Humanoid:MoveTo() to keys

Basically.
I use Humanoid:MoveTo() and the player moves to that position. But I want to illustrate the keys it would be pressing.
So if I like press W, it moves forward. But as I said I use Humanoid:MoveTo(). I want it to print the keys it would be pressing.
MoveTo(10,10,10)
What key’s would I press, or hold, to go to that position in workspace.

This is confusing

To make it clear I’m using pathfinding service, and I’m in a car. I cant move the humanoid because it would not move the car. So somehow I have to translate the movement to keys. Dont give me it like
’ ooh you should put a function in the car ooh use this method which is not related at all to this ’

1 Like

Try Humanoid:Move() instead. It might work, but I’m not sure.

read what i said carefully. I am in a car. It uses keys ‘wasd’ to move

I’m not sure what the point is if you’re using WASD to move. You cannot press keys for the player, so this doesn’t make sense.

Yo man. I have to translate the player moving to a point in keys. So like to move to vector3 10, 10, 10
I lets say would have to hold W and A to go that way.

Alright, so if you’re getting this from a player and you want to know what direction they’re moving in, you can use Humanoid.MoveDirection. You will have to translate this into keys somehow.

This is what I am trying to say. I don’t know how may I translate it into keys

Oh, got it. Well, if the seat is a vehicle seat, you know the Throttle and Steer.

But, to translate it into keys, you will need to do some sort of a CFrame comparison. That’s where I get confused on where to start.

MoveTo() doesnt make MoveDirection tho

game:GetService("UserInputService").InputBegan:Connect(function(key, gp)
	if key.KeyCode == Enum.KeyCode.W and not gp then
		--do what you do
	end
end)

game:GetService("UserInputService").InputEnded:Connect(function(key, gp)
	if key.KeyCode == Enum.KeyCode.W and not gp then
		--do what you do i guess again and prevent the began function from running
	end
end)

you can repeat these functions and do what’s left up to you

MoveTo isn’t related to vehicles it’s related to humanoids so I believe you’re confused.

1 Like