[BUG] Demo Character Preset Problems After Different Import Order (TPC+FPC)

_aL

New member
1. Third Person and First Person Character Controllers imported separately
2. Unity Version 2019.4.18f1

3. I purchased TPC and FPC at different times so when I import them I do so one after the other.
  1. When I first import the FPC and then TPC and open the "UltimateCharacterControllerDemo" scene first person perspective becomes unusable. After switching between perspective using the "V" key, the Movement Type under Locomotion script briefly goes to "First Person Combat" and then instantly switches to "Third Person Adventure" mode. But the camera stays in first person mode and when you try to move, the character only moves forward, no matter which key you press (like A, S, D). In this scenario the 2.5D and Top down works fine.
  2. When I first import the TPC and then FPC and open the "UltimateCharacterControllerDemo" scene the first person controller works fine. But this time the 2.5D and Top Down sections of the demo fail to change camera perspectives. Although in 2.5D the character can only move sideways without following the "path". In this scenario I looked around and found out that the 2.5D and TopDown states under the UCLocomotion and some other components are not there.
Causes & Fix for No.2 : In the "ThirdPersonControllerDemo" scene everything works fine regarding the 2.5D and TopDown. So I created the 2.5D and TopDown states in the UCCDemo scene. The states I recreated are for the Camera Controller, UC Locomotion, Unity Input scripts and also for the item "Aim" Ability. Those changes seem to fix the problems that I've noticed with the demo scene mentioned in the second problem.

Causes & Fix for No.1 : I realized that many presets for the states under the Locomotion script were missing. One of the missing presets was the "FirstPerson" state. So creating it fixes the movement issue. But the below screenshot of the states under the "UC locomotion" script makes the reason behind these problems obvious (many states are missing in each one). Different importing orders changes which states are present on Nolan. I guess the Nolan and Camera gameobjects just gets overwritten along with their components once the other controller package is installed.

Ashampoo_Snap_Tuesday, January 26, 2021_23h28m45s_001_.png

4. Steps to reproduce:
  1. New unity project
  2. Import FPC using package manager
  3. Import TPC using package manager
  4. Install FPC using Tools/.../Opsive Installer
  5. Install TPC using Tools/.../Opsive Installer
  6. Update Layers&Inputs in Project using the relative buttons in Main Manager/Setup/Project
  7. Start "UltimateCharacterControllerDemo" scene
 
Thanks for the report. It looks like the build script is modifying the main demo scene when it shouldn't be. I will take a closer look at this.
 
  • Like
Reactions: _aL
I found out that this kind of separate importing causes other issues as well.
This one only happens when TPC is installed first and then FPC, only when using URP instead of the Standard RP. In the Demo scene Nolan cannot load its "Movement Type"s. The scene cannot be loaded. Console shows this error:
AddFirstPersonCamera.png
Also when trying to crate a new character and selecting "Both" as perspective throws these errors with a character being created with only third person view type.
Opsive New char in URP with Problems.png

These errors seem to be generated because the "ViewTypeBuilder" class has this preprocessor directive:
If First Person Controller.png
* Once the preprocessor directive is removed these problems go away.

I created multiple fresh URP projects hoping it might be an import issue, but all of them had this problem. I'm using version "2019.4.18f1".
Again this only happens when TPC is installed first and then FPC, in URP.
 
Another screenshot that might help understand the issue (Code is greyed out in Visual Studio):
Opsive URP FPC Camera problem.png
 
This has been fixed with the latest version. Make sure the welcome manager says version 2.3.3.
 
Top