Character aligns with vehicle's rotation after exiting

ipleomax

New member
In the UCC demo scene, I added a flat cube that is sloped at 45 degrees. If I drive over the cube and exit the vehicle, the character's up direction will stay aligned to 45 degrees. How do I change this behavior to always align with world-up?
 
I don't see this happening in the demo scene - do you have Nolan's "Align To Ground" ability enabled?
 
Sorry, even with that enabled, I can't reproduce this in the demo scene... I've tried using both first and third person views. Have you changed anything else about the character/car/camera?>
 
Sorry, even with that enabled, I can't reproduce this in the demo scene... I've tried using both first and third person views. Have you changed anything else about the character/car/camera?>

I finally got the chance to create an empty project (Unity 2020.1.6f1) with just UCC installed. And then unchecked "Use Root Motor Position" and checked "Teleport Enter Exit". Although unchecking Root Motor Position doesn't affect it.

Here's the video showing my issue:
 
I also just tried to reproduce it but wasn't able to. Are you running the latest version?

Line 367 of Drive will position the character according to the gravity direction. Unless one of the align abilities have been started the gravity direction should not change from Vector3.down.
 
I also just tried to reproduce it but wasn't able to. Are you running the latest version?

Line 367 of Drive will position the character according to the gravity direction. Unless one of the align abilities have been started the gravity direction should not change from Vector3.down.

I'm using UCC version 2.2.5. I haven't imported any other ability addons in it.

Line 367 of Drive Ability is
C#:
m_CharacterLocomotion.AllowRootMotionRotation = true;

However, line 375 is
C#:
m_CharacterLocomotion.SetPositionAndRotation(startLocation.transform.position, Quaternion.LookRotation(forward, -m_CharacterLocomotion.GravityDirection), true, false);

To confirm the version, I cleared package manager files from AppData and imported for Unity 2020 (using package manager) and 2019 (using asset store).

I still get this issue on both projects. I only tried all this on my PC. Will try on a different computer and let you know.
 
It does look like my development version has different line numbers. Line 375 is correct for you though - is the gravity direction pointing in the Vector3.down direction?
 
It does look like my development version has different line numbers. Line 375 is correct for you though - is the gravity direction pointing in the Vector3.down direction?

The gravity direction changes when exiting.

In order to find out why it happens to me but not for you guys, I set the spawn point near the car. Now it doesn't happen the first time I get out of the car. Only the next time.

What seems to cause this is the DriverLocation StartLocation transform. If the car is angled when entering, character will exit angled as well, no matter the ground normal or previous character rotation when exiting.
 
Last edited:
Yeah, I am able to reproduce it now - using Teleport Enter/Exit, the character gets aligned to the ground after the first time exiting. Thank you for reporting this! Will hopefully be fixed in a future update. Not sure if there's an easy workaround for now, Justin may be able to help there.
 
Thanks for narrowing this down. This can be fixed if you move the following within Drive.AbilityStarted:

Code:
            m_CharacterLocomotion.AlignToGravity = true;
To the end of the method. This should be executed after SetPositionAndRotation within that method.
 
Top