How could you implement Steering Wheel support?

Hey there! I’m currently working on a game that’s heavily centered around vehicles, and one idea I had to differentiate my project from other similar places was to implement a sort of steering wheel support.

I didn’t really think one bit that this would be simple to do, as most car games would probably have this implemented in that case, but I still had my hopes up for an easy solution that doesn’t require a rework of my interface for full controller support.

Accelerometer
I browsed a bit through the UserInputService devforum post, hoping there would be a simpler solution than what I thought about up until now, but all I found which might be useful was the Accelerometer API. My steering wheel recently broke down, so I cannot test if I can set it to be recognized as such, but it’s one idea.

Joystick
Another plan was to register the movements of the steering wheel as a simple joystick from an Xbox controller: this would be easier to set up by a player and would probably work decently, problem is I’m not sure if this would require my game to be Console enabled, which would lead to a lot more issues down the line, plus as mentioned earlier, the interface needing a rework to let you browse with just a controller.

Mouse Position on screen
The last idea was to freeze the camera, as to not register looking around like steering, and control it based on MouseX or MouseY, as it’s the only “potentiometer” I really have easy access to. While this would need a more complicated set-up from a user’s perspective to make their steering wheel angle represent a specific mouse position, this comes with the least downsides and might be the simplest to implement from my perspective, as I never worked with controllers before.

All said, I’m not sure which option to try, and as I’m not experienced with controllers, I’d need some help with how I can read all this data. I also watched a video which made me believe Greenville has a sort of support for these, but I’m not sure if it’s official or just some combination of settings from both the game and controller itself;

1 Like

They would all work. However, Roblox does not detect steering wheels for input.(IIRC)

However you can use the MouseLocation, Joystick and the Accelerometer to have a “sensitive” steering wheel.

Accelerometers can be used to detect the orientation of a phone. Then you can use the orientation of the phone and simply use that to control the car.

For Laptop and Desktop however I find that Mouse controlled vehicles are not that easy or intuitive to control. It’s probably how the Camera has to be locked since you can’t use your mouse for Control and Camera at the same time.

So, I also recommend you have the A and D keys available for input. Also, for keyboard you could have the steering delayed or have steering force instead of a steering direction a small amount so that the steering doesn’t feel jerky.

I think I will be working on something similar very soon. I will let you know when I finish it.

1 Like