OuterGazer
New member
Hello everyone!
I am trying to implement a Space Movement ability that allows the character to rotate freely in all directions and where the character is always facing forward, rotating with mouse movement.
My main problem is the camera movement not keeping itself relative to the local axis.
For an example, if in the Combat ViewType in Third Person you establish the Pitch limit to -90 and 90 (basically allowing for limitless pitch), as you turn completely around the X movement is inverted.
In the Combat version of the First Person this is solved in the overridden Rotate method by checking the pitch value and multiplying horizontalMovement by -1.
Now comes rolling the character. I acknowledge that I may not be doing things the proper way as I'm still new to the UCC and uncertain on how some things may work.
In the ability script itself, in an overridden UpdateRotation() I check for the rolling input and then apply the rotation to m_CharacterLocomotion.DesiredRotation after some lerping. However, the camera here doesn't follow the character and if I set AlignToUpDirection to true when starting the ability it does align, but rotates the character endlessly, and stronger the greater I move the mouse.
Another alternative I tried was, in this same method, grab a reference to the camera and set its rotation the same as the previous one. I know for sure this isn't how something like this must be done because, even though now the camera's up aligns properly with the character, the mouse movement doesn't "update", so to say, and keeps moving in the original axis before any roll was applied, causing a similar problem to the pitch example mentioned earlier.
After some digging, I have seen that maybe I need to override the Move() method from ThirdPerson (ViewType)? I've been a couple of days banging my head against the wall and I would highly appreciate if someone could point me in the right direction.
Cheers!
I am trying to implement a Space Movement ability that allows the character to rotate freely in all directions and where the character is always facing forward, rotating with mouse movement.
My main problem is the camera movement not keeping itself relative to the local axis.
For an example, if in the Combat ViewType in Third Person you establish the Pitch limit to -90 and 90 (basically allowing for limitless pitch), as you turn completely around the X movement is inverted.
In the Combat version of the First Person this is solved in the overridden Rotate method by checking the pitch value and multiplying horizontalMovement by -1.
Now comes rolling the character. I acknowledge that I may not be doing things the proper way as I'm still new to the UCC and uncertain on how some things may work.
In the ability script itself, in an overridden UpdateRotation() I check for the rolling input and then apply the rotation to m_CharacterLocomotion.DesiredRotation after some lerping. However, the camera here doesn't follow the character and if I set AlignToUpDirection to true when starting the ability it does align, but rotates the character endlessly, and stronger the greater I move the mouse.
Another alternative I tried was, in this same method, grab a reference to the camera and set its rotation the same as the previous one. I know for sure this isn't how something like this must be done because, even though now the camera's up aligns properly with the character, the mouse movement doesn't "update", so to say, and keeps moving in the original axis before any roll was applied, causing a similar problem to the pitch example mentioned earlier.
After some digging, I have seen that maybe I need to override the Move() method from ThirdPerson (ViewType)? I've been a couple of days banging my head against the wall and I would highly appreciate if someone could point me in the right direction.
Cheers!