Does this exist? a single way to detect player attempting to move, any device

I’m thinking this does not exist, but I thought I’d ask anyway. (yes I have searched already)

Is there a way to detect of any player is attempting to move their character that works on any device. Mobile thumbstick, xbox thumbstick, and WASD keys?

Now before you say, ‘use humanoid.movedirection’… well lets assume you can’t use that. I want to know if they are trying to move(even if they cannot move, example in a seat or otherwise welded or whatever).

So how can you detect if they are trying to move if they cannot?

Roblox has been able to do this with vehicle seats. They can detect any input device is trying to move(even if they are not moving) with the throttlefloat and steerfloat etc. You can see the numbers changing no matter what device it attempting to move their thumbstick / WASD or whatever. I’m sure there are hundreds of lines of code in the background hooking all of the various input devices to the seats.

But is there any simple way to detect this input, across the board.

It would be nice if there was a Humanoid.movedirectionInput property that could be utilized, but I fear I may be looking for a unicorn here.

1 Like

Sadly, your only real option is to efficiently utilize ContextActionService.

It will make it relatively simple to account for inputs across multiple devices & even allows you to enable player-customized inputs for outputs.

However, if you care to explain what your necessity and intended implementation of this is, it’s possible we could suggest alternative methods that are more simple.

I have a script that controls the fall rate by bodyvelocity. The horizontal components maxforce set to zero to enable ‘walking’ for movement while falling (simple glider).

I was going to add a wind drift vector, but setting the horizontal forces of the bodyvelocity will cause the WASD(walk) controls to not work. If I could detect attempts to walk, I could zero the bodyvelocity maxforce while this is happening, then put the force back when they stop ‘walking’.

If it was only keyboard input i had to worry about it would be pretty easy, but for mobile and gamepad, … I’m thinking the juice isn’t worth the squeeze in this case.

Why could you not apply the force horizontally? I’m not sure I’m understanding.

Could you not use available BodyMovers to apply any force you wanted without interrupting walking pattern? A very basic, archaic example is how the “conveyors” you see in tycoon games that whizz you around the map are entirely subject to the forces applied by walking. If I walk against it, I fight the applied velocity. If I walk perpendicular to the conveyor, it pushes me to the side, but my forward velocity is unaffected.

I may be misunderstanding.

no, if you apply a horizontal bodyforce to the humanoid then they can’t walk with the walk controls.