Locking Camera movement to only the X axis
I am creating a 2D platformer-esk game; However, the character can jump , which moves the Camera on the Y axis which I do not want, How would I go about moving the Camera on the X Axis regardless of player's Y and Z position?
asked Jun 18 '14 at 11:38 PM in Blueprint Scripting
You might want to attach the camera directly to the character mesh without a spring arm in between. Setup the proper Z and Y values in the camera properties. Update the X axis of camera on the Tick function of the character.
But keep in mind that this sometimes result in camera getting blocked by other objects. To avoid this, you might want do do a trace from mesh to camera and using the hit-info, relocate the camera. But if your level design allows you to make sure that the camera is never blocked (like in Mario games), you dont need to do this.
answered Jun 19 '14 at 05:38 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here