Hey everyone, I’ve been working on coding for a scrolling camera for 2.5 shmup game that my guys and I are developing. I have been trying to get the main camera to scroll across in unity 3D while it’s locked to the player ship. Several things happen though, either the ship moves off the screen or the camera moves but not the ship. I can get 3D objects to scroll across the way I need them to; however, I can’t get the camera to move across and lock onto th]e player, and allow the player ship to move freely within. Is there a basic coding setup that I can use to create the illusion of a horizontal side scrolling shmup, similar to what the developers of Sine Mora had done? Getting frustrated and I seriously need some help guys. Thanks
The Sine Mora camera is anything but simple. It’s not the typical horizontal moving camera, it does many cinematic angles.
If you simply want the camera to move horizontally, both the player and the camera must have the same startingSpeed. This way they both have the same base speed.
To make the player move the player back/forth you add or substract from that base speed (ex: startingSpeed + forwardSpeed; )
You then need to limit the player movement so it doesn’t go past the camera’s X position + offset and can’t go behind its X position - offset.
It seems that the camera moves at a constant scrolling speed…