Lock/Restrict SpringArm Rotation
I'm currently setting up my Pawn, and I've come across an interesting problem with rotation.
As it currently stands, I've got a sphere at the origin, and my pawn camera should orbit that sphere (which it currently does) with W/S controlling pitch (up/down) and A/D controlling yaw (left/right).
My blueprint looks like this:
The issue with this current setup is that I want to make sure the camera is always 'upright'. In other words, I only want the camera to move up/down/left/right and never at an odd angle around the sphere. The issue here is that currently you can rotate at any angle and get upside down, as well as the controls reversing on the opposite side of the sphere.
Hope I'm explaining this well enough. Here's a diagram:
Just wondering whether there is an easy/efficient way to approach this. It's times like this when I wish my math didn't suck really bad.
Thanks for any help you can offer! :)
asked Jan 03 '15 at 06:28 PM in Blueprint Scripting
Resolved this. I have a habit of resolving my own issues, but I figure it'll help someone else even if I do :)
It's as easy as this:
This being the component layout for the Pawn:
Yaw (Left/Right) rotation is managed by the ArmRoot (sphere component), and Pitch (Up/Down) is managed by the Spring Arm itself. This might not be a necessary distinction, but I find it easier to understand this way anyway.
I haven't yet tackled the issue with the poles, however I'm leaning towards restricting the camera from going that far up/down anyway, so it won't be an issue for me after all.
answered Jan 03 '15 at 07:37 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here