AC UCC character rotation issue on cutscene start

Unfortunately I do not know AC well enough to be able to answer, but if you can reproduce the issue within AC then I can take a closer look at it.
 
Chris replied on the AC forum that he recreated the issue, I'm sure he'll be able to fix it :)
 
Hi, Chris said on the forum that you two talked about it and that the source of the issue appears to lie with the UCC camera view type. Could you please expand on that ? Thanks.
 
Ah, yes. You are using the Combat View/Movement Types as a static camera which is causing the look rotation issues. The Combat type is meant for being behind the back so when you lock it in place the look direction is going to be incorrect. The correct solution here would be to create a new Static View Type (and likely the Adventure Movement Type) that then returns the correct look direction.
 
Hi, here is a new video on the subject :


-First, I believe we are not on the same page regarding the Combat camera. It is constantly behind the character's back and not locked away.
-In addition, the issue doesn't seem to be limited to the Combat type only. While they are harder to see, rotation issues can be seen when using the Adventure movement and view types. Just move your mouse around, and you may see small rotation movements when the cutscene ends.

I hope this was helpful and that we can be on the same track, thanks.
 
When the game is paused and unpaused the camera is not behind the character's back, with the mouse having an offset. This is what is causing the issue, even though the UCC camera is behind the character's back. The correct solution here is to have a static view type that just uses the character's forward transform rather than taking into account the rotation determined by the mouse.
 
Hi and sorry for not coming back to this earlier, so we are on the same page here is a simple static view type test script :

C#:
namespace Opsive.UltimateCharacterController.ThirdPersonController.Camera.ViewTypes
{
    using UnityEngine;

    public class StaticTest : ThirdPerson
    {
        public override Vector3 LookDirection(bool characterLookDirection)
        {
            return m_Character.transform.forward;
        }

        public override Quaternion Rotate(float horizontalMovement, float verticalMovement, bool immediatePosition)
        {
            return m_Character.transform.rotation;
        }

    }
}

This view type is activated using the state system when the AC_Motion ability is active. Is this what you had in mind ? If yes, then that does not solve the issue, as the character gets rotated when the cutscene ends if the player was still moving the mouse when it began. From my perspective, this view type is not really needed, the issue seems to come from the initial view type catching up with some rotation input.
 
The camera should be stationary all of the time, correct? In that situation the view type should also be set the entire time, and not switched. The combat view type shouldn't be used at all.
 
Ah sorry there was a misunderstanding, so you want me to setup a static UCC camera and not use a Combat one for tank controls all along. I can definitely try that, in fact it could be interesting beyond the scope of this issue, but that doesn't properly fix the issue here - many games don't have RE style controls and camera, and we should be able to have a conventional view type working correctly when using UCC and AC together. I hope you can find a way to prevent this rotation issue when using a standard view type all along, I will look into this some more when I have the time.
 
Hello, here's one more video showing the horizontal look vector from Player Input not being zero when the cutscene ends :


I cannot pretend to understand all of the subtleties of UCC's and AC's input handling, but I'm pretty sure that something is wrong here, there's no reason for that number to not be zero when the mouse is no longer being moved. Hope this piece of info is useful and that you and Chris can make sense of it, thanks.

Edit : It might be worth mentioning that I tried changing GetLookVector's smoothed bool parameter to false, and it did not solve the issue.
 
Last edited:
Are you disabling the gameplay input? The only way that value would not be 0 is if the input is still being retrieved. GetLookVector returns the look vector which is zeroed out when the gameplay input is disabled, and the component is disabled which prevents that value from being set.
 
I was not disabling the gameplay input, the AC_Motion ability does not do that as far as I know, as you can see in this video the Unity Input and Ultimate Character Locomotion Handler are still enabled when the ability is active. You can however see the same issue happening when using the Combat view type and using the OnEnableGameplayInput event.


I'm not sure how relevant this second situation is as the look vector doesn't change when reenabling the input, the camera does not move, only the character does to match the camera's direction. Still, I hope all of this is useful.
 
I do think you should disable the input for that use case. With that said, as you mentioned the character is rotating to face the camera direction so that's expected with the combat view type. I think this goes back to the original issue of using the combat view type. Have you tried disabling the input and using your own stationary view type?
 
Hello, a chunk of the topic is missing here due to a forum issue, but here are two simple fixes for those rotation issues ! First of all, when using a control scheme like the Combat one, we need to use the Tank Controls Direct movement type in the Movement section of the Settings tab. It makes sense when you think about how the Combat movement and view type work, there's a reason why I've been relying on them for actual tank controls in my game ! When using this parameter, the character no longer rotates in an unexpected direction when the cutscene begins while he is moving.

Next, I expanded this condition at the beginning of OnAbilityActive in the Combat view type script :

C#:
if (!(ability is MoveTowards) && !(ability is PathfindingMovement))

As AC_Motion inherits from PathfindingMovement, the rest of the void is successfully called and m_RotateWithCharacter is set to true and m_Yaw to 0. This results in the character's base rotation to be only a tiny bit affected when a cutscene begins. The character's upperbody rotation can easily be visibly affected, but for the moment I think it is tolerable, as the main issues were the significant character rotation when starting or ending a cutscene.

Lastly, here is a video illustrating all that :


I'll be trying to complete and share a custom tank control scheme for UCC in January, but this progress has already been quite a relief, and I hope these notes can help somebody else in the same niche that I am in, using UCC, AC and tank controls ! In any case, happy new year to anyone reading this 🥳
 
Back
Top