It’s not a super easy problem to describe, but – I’m trying to make a custom on-screen joystick for a mobile game, where moving the joystick will move the player. The actual movement of the joystick works perfectly, and the way it moves the player is by applying a force to that player. However, once I add a camera to the mix, it kinda breaks everything.
I’ve done some testing, and I’ve narrowed it down to being the force applied to the player that creates issues. I’ve tested this with two events – one that applies a force to the player, and one that centers the camera on the player. To summarize my findings:
- If the camera is centered on the player but is on a different layer (e.g. player on base layer, camera on background layer), the camera will follow the player, but for some reason the player will be a lot faster than the camera and will eventually go off screen.
- If the camera is centered on the player and is on the same layer as the player, absolutely no movement will happen.
I’ve tried to follow a few joystick tutorials, but none of them involve camera movement, so I’m lost as to what I can do. Any insight or help would be appreciated.