Hey y'all! I need a camera controller that works with joysticks well. I'm currently working on an FPS, which is pretty much almost done. I've had the same Camera control script for a while, and its worked fine with mouse. I had button controls for the camera too which I pretty much ignored. But when I picked up a controller, it felt ridiculously janky. I tried camera smoothing and other things but it still felt weird. All the github projects I found only had options for mouse controls. I figured it's not worth re-inventing the wheel, so is there anyone who has or could reference me to a camera script compatible with joystick controls.
I’m working on something that I finished yesterday. I can post it up, but I haven’t written the README yet. It supports keyboard and mouse as well as controllers.
It also keeps track of which was used last and can give you an icon for an action based on the last input used.
So if you have interact as the X button on the X-Box controller, and ‘E’ on the keyboard and you ask for the texture for the Interaction action, you’ll get an image based on whether the player last used the mouse/keyboard or joystick. It currently supports XBox, PS and Nintendo controllers. I’ve tested XBox and PS4 controllers. I don’t have a Nintendo one, and I have plans to add Steam Deck support.
It also supports saving/loading kybindings. The UI for that is in a template project I’m still working on, but it all works. It uses resources to save whatever rebindings are made by the player and it all works. (No documentation on usage yet other than code comments.)
I’ll get the Camera Controller up in a bit. The two work together. The camera controller is a Cameras Node you pop on the player. You can then drop as many cameras on it as you want and the player can switch through them by pressing right-stick or ‘C’ (or whatever bindings you setup. This allows me to switch between 6 camera setups so far. With the first person camera it assumes (for now) that the player’s head is on camera culling layer 2 only. That way when you’re in first person mode, you can put the camera in the middle of the player’s head, and they can’t see their head, but anyone else looking at them (in multiplayer) would see it, and if you switch cameras, default cameras see it.