Why the UCC needs the Canvas to work? Looking for info and solutions.

Alarconte

New member
Why the UCC needs the Canvas to work? I don't see documentation about it.

I'd like to add the canvas to be controlled via Adventure Creator so I can use their game logic to control when it shows and what it shows, or just delete the UCC canvas, or parts of it, if I find nothing of interest beyond the crosshairs for my project.
But tampering with the canvas (disabled, enabled on runtime...) gives all kind of problems to the characters, like different camera anchor positions and general errors.
Is there any minimal guide to adapt the canvas beyond default?

It will be nice to be pointed to the right direction....
Even if just what are the minimal things in the canvas that cannot be deleted without spending hours trying combinations..... Or finding a month later that something would be utterly broking without, I don't know, the Damage Indicator for example.
 
UCC does not need a canvas to work. The demo scene needs a canvas to select the initial view type (first / third person). But if you set up your own scene it works perfectly fine without canvas. In the scene part of the setup section in the character manager you can choose to add / not add the UI elements.
 
Yes, I've checked that without any integrations, I can go without the canvas.

But attaching it to Adventure Creator to be controlled by it (I'm just in an initial testing phase), in just the basic setup where AC just controls that the canvas is on or off, if the canvas starts locked, the character breaks (bad camera anchor, no weapon IK, etc). (The references to the character are still active). Looks quite strange, and I'll possible have to ask in both assets forums, So I'd ask to know where to start to look at, whats the relation between the Canvas and UCC control (why it breaks), as I know AC better and I'll ask later there how to bypass those problems.
 
The character controller doesn't require a canvas. I didn't create the Adventure Creator integration so I'm not sure what relationship there is there.
 
Thing is, I'm on the final phases of integration (character working well and being able to save and load the game via AC).

As many other threads point to the problem, when not assigning correctly on runtime the character, camera and canvas, things break (particularly, IK).

I instantiate and assign them via AC, and everything works (well, IK and camera anchor is kinda off in comparision that when the player starts on a level, but if is kinda off in a constant way, (like... when loading the game), I can just adjust those damn freelook presets and ik presets etc to adjust for the offset. (I learned that the hard way, never deactivate fully the character, or that problem will ocurr and you will never know why happens.)


I'm trying to implement the script (character section of the documentation) of instantiating the 3 elements and assigning them to the character but I'm bad at coding and getting some "cameracontroller" has no reference in "camera" stuff. Well, while I fight to solve that, I'm trying to assign them with the correspondent action in playmaker, but it only exist for the camera, not the canvas, and problems persists (when Loading a game... IK is disconnected from the character), IK presets don't apply etc, and everytime I save and load, the IK goes off a bit more.

So While I figure out how to code that simple code pointed out in the character section of the documentation to try it out, I would like to understand the interaction with canvas too, so I can know in my workarounds If I can solve anything. (Like... the crosshairs work when loading the game but... do they break the IK? Do the camera break the IK? Is the IK who breaks himself?

This is quite a piece of complex coding asset and I'm just a noob on C#.... I usually spend and afternoon trying to write the correct sentences until I leave and fix it in 5 minutes in playmaker.

So I'm just trying to understand in order to fix it.

And not sure if the Save system from Opsive would be a solution as I already going to use the AC saving system as primary method, and as right now, every integration with UCC has been quite rough.
 
BTW.... my workaround for months was just having the player, UCC and managers on a scene, and use additive scenes to load levels (that works well with AC). But Unity Lightmapping bugs has being making that impossible, so I decided go the Logical way and use prefabs for the player and what the player may need.
 
I do not have much experience with the Adventure Creator integration but I do know that you can hook everything and spawn a character at runtime by following the DontDestroyOnLoad docs below. The PUN add-on does something similar and it spawns the character at runtime.

 
I do not have much experience with the Adventure Creator integration but I do know that you can hook everything and spawn a character at runtime by following the DontDestroyOnLoad docs below. The PUN add-on does something similar and it spawns the character at runtime.


As said, I'm bad at coding. I get lots of errors with this script. (Character and CameraController... Sometimes the erros are about that Shared is not an Opsive reference... I don't know, I'm lost at this).
I've been 20 years doing games with Visual Coding tools.... I only script when is no way to solve other way, or bash my head against a wall to make custom FSMs etc.

the AC integration has no specifics problems for this issue. I just need to instantiate correctly the player and its related objects so specially the IK don't break. (Btw, is the regular UCC IK). Well... So nothing break.

And reassign'm in load, or destroy them and instantiate them again fresh as I made AC handle all UCC inventory, atributes etc.

I don't even have to control that much UCC with AC, but I would be preferable if I don't have to destroy them so the link with AC continues when loading the game.
 

Attachments

  • CreatePlayer.cs
    2.6 KB · Views: 1
I'm giving a lots of turns to the script and nothing. Any help please?
(for example..... I find no way to make <Character.UltimateCharacterLocomotion> got readed What are the assembly references or wathever needed?
 
Anyway, I don't even know why this is relevant.

Instantiating them with that script looks no different to me than instantiating them in any way and assign the camera to the player. (beyond the Camera attachment being off than if the player is spawn at the level), See 1.

1. The controller should work the same good, being the player and Camera at scene start, or being spawned and assigned. And if not, should be explained in the docs why not, and how to's. But this is not the topic. (but is a problem... Looks like I'll have to test lots of scene changing and saving and loading both in editor and player to make sure the CharacterController doesn't make more random changes...)

2. Is not only the IK; The camera is re-assigned on Load, but 0 presets apply. Nor to the camera, nor the Locomotion, nor Ik. Nothing. The character "works" and do its abilities, but... I guess what happens is that the whole character is not assigned in the Game Manager. (aka the State Handler of it) So.... How to re-assign it when Loading a game?

I'm not sure if the documentation about the game manager is not that much existant or if is too much spread on the documentation. But looks like it should be more documentation about it.


3. Well, no need if the Game Manager is Don't destroy on load.
-If the Game Manager starts on scene but has don't destroy..... When loading a game, everything is assigned and works "well" (see 1).
- If I spawn the game manager, half of stuff breaks, as on start it considers the game manager is not present so it creates the manager stuff.
-If no Game Manager is in scene at all; something (I guess the player) spawns it different parts on scene, but things happens (like no footsteps etc... other times things work, quite random.)
-With the Game Manager in scene and Don't destroy, looks like everything works (except canvas crosshairs 'cause I don't know what I do but now the canvas (I use only crosshairs) don't work. Anyway, I could totally do away without those crosshairs, but I'm trying to make a game that know how its works, so I need to know how the game Manager works.
-For some strange reason, when saving and loading the game, a new Game Manager appears on the Don't Destroy list.

But this is going to be problematic along all the project development if I just don't know what is the correct way to spawn and

Then is when Canvas hits again. If the crosshairs were working... (thing I've not achieved in the last 8 hours),, after loading, the Game Engine object starts saying the crosshairs are not assigned, when they are. Kinematic object manager the same, not loading the game, just loading another level. Why, if the Game Manager is in don't destroy and shouldn't be initialized again?

What is the correct way to use the Game Manager? One per scene? One on first scene?

How the Opsive Save System handles the Game Manager? I don't see any reference to it in the documentation.
How supposedly the Dialogue System integration saves everything corectly. I can't see it in the documentation?

I would have no problem buying any of those assets if I knew their save system would be compatible with saving and loading the game via Adventure Creator...
(Save opsive stuff -> Save AC -> close the game. Open the game -> Load with AC -> Load opsive stuff).
 
I'm giving a lots of turns to the script and nothing. Any help please?
(for example..... I find no way to make <Character.UltimateCharacterLocomotion> got readed What are the assembly references or wathever needed?
If you are unable to reference a namespace then make sure you have included the assembly definition. This page has more info under assembly definitions:


2. Is not only the IK; The camera is re-assigned on Load, but 0 presets apply. Nor to the camera, nor the Locomotion, nor Ik. Nothing. The character "works" and do its abilities, but... I guess what happens is that the whole character is not assigned in the Game Manager. (aka the State Handler of it) So.... How to re-assign it when Loading a game?

I'm not sure if the documentation about the game manager is not that much existant or if is too much spread on the documentation. But looks like it should be more documentation about it.
The character controller doesn't contain a Game Manager component. The documentation above about DontDestroyOnLoad is what you want to what to do from the character controller perspective. It is essentially:

- Get a reference to the camera
- Assign the character to the camera with the Character property
- Get a reference to the CharacterMonitors
- Assign the character to each monitor with the Character property

3. Well, no need if the Game Manager is Don't destroy on load.
-If the Game Manager starts on scene but has don't destroy..... When loading a game, everything is assigned and works "well" (see 1).
- If I spawn the game manager, half of stuff breaks, as on start it considers the game manager is not present so it creates the manager stuff.
-If no Game Manager is in scene at all; something (I guess the player) spawns it different parts on scene, but things happens (like no footsteps etc... other times things work, quite random.)
-With the Game Manager in scene and Don't destroy, looks like everything works (except canvas crosshairs 'cause I don't know what I do but now the canvas (I use only crosshairs) don't work. Anyway, I could totally do away without those crosshairs, but I'm trying to make a game that know how its works, so I need to know how the game Manager works.
-For some strange reason, when saving and loading the game, a new Game Manager appears on the Don't Destroy list.

But this is going to be problematic along all the project development if I just don't know what is the correct way to spawn and

Then is when Canvas hits again. If the crosshairs were working... (thing I've not achieved in the last 8 hours),, after loading, the Game Engine object starts saying the crosshairs are not assigned, when they are. Kinematic object manager the same, not loading the game, just loading another level. Why, if the Game Manager is in don't destroy and shouldn't be initialized again?

What is the correct way to use the Game Manager? One per scene? One on first scene?

How the Opsive Save System handles the Game Manager? I don't see any reference to it in the documentation.
How supposedly the Dialogue System integration saves everything corectly. I can't see it in the documentation?
I am not familiar with the Game Manager component that you are referring to so I'm not able to help there, but for Save System or Dialogue System questions I would contact Pixel Crushers as they are maintaining the integration.
 
3. Of course you have a game manager.

"Set up Scene level-Managers to the scene"
Button: Add managers.

Creates One manager. Its called Game. So I call it to you, Game Manager.

2. Yeah, you didn't read my post. I already did that. Except for the CharacterMonitors. In the script provided in your documentation, the canvas is only spawned, no references assigned on that script, That example is made to make the game objects don't destroy on load that are present already in the scene in editor with the references assigned, not in prefab. I already read a post about this but of course, the answer was left for the user to solve.

That's why I ask how its internally assigned. As said, the Don't destroy on load (On the Game ManageR) work for mantaining the references, even on load, is the Game Manager who is giving problems (Like creating itself again and again in every load)

So, if the "game" has to be on scene, but generating the character as a prefab make it not work, unless Game is also a prefab, I need to understand how to solve it. I guess, probably, you make games, and you know how to work that out.

1. That didn't help. If the script is so easy you could tell me what is the assembly required, 'cause Visual Studio just say those assemblies don't work. If you would have look at the script, you would have seen that I tried a lot of assemblies. But as said, I guess doesn't matter, I can just instantiate them and assign them with visual coding, unless there is some inner crank you know the answer that I have to code to apply.

So:

You made a Game component (a character controller in this case, that specifically includes the character controller, the camera, and the game manager). Not a project-wide controlling asset.

I think is quite reasonable that users ask some tips to integrate your code in the rest of their code, as your code is meant to be only a part of a bigger project.
 
3. Of course you have a game manager.

"Set up Scene level-Managers to the scene"
Button: Add managers.

Creates One manager. Its called Game. So I call it to you, Game Manager.
Ah, I thought that you were referring to a specific class called Game Manager. Those singletons just need to be in the scene ahead of time. You should not need to spawn them dynamically.

1. That didn't help. If the script is so easy you could tell me what is the assembly required, 'cause Visual Studio just say those assemblies don't work. If you would have look at the script, you would have seen that I tried a lot of assemblies. But as said, I guess doesn't matter, I can just instantiate them and assign them with visual coding, unless there is some inner crank you know the answer that I have to code to apply.
It's not a script problem, it's an assembly definition problem if visual studio can't find the namespace. The docs give a good example but here's a direct link to Unity's documentation:


2. Yeah, you didn't read my post. I already did that. Except for the CharacterMonitors. In the script provided in your documentation, the canvas is only spawned, no references assigned on that script, That example is made to make the game objects don't destroy on load that are present already in the scene in editor with the references assigned, not in prefab. I already read a post about this but of course, the answer was left for the user to solve.

That's why I ask how its internally assigned. As said, the Don't destroy on load (On the Game ManageR) work for mantaining the references, even on load, is the Game Manager who is giving problems (Like creating itself again and again in every load)

So, if the "game" has to be on scene, but generating the character as a prefab make it not work, unless Game is also a prefab, I need to understand how to solve it. I guess, probably, you make games, and you know how to work that out.
I just tried this and you don't even need to assign the character to the monitors. So there's no need for the last two steps in my above post. I've attached my test scene and script which spawns the character at runtime. Hopefully that helps.
 

Attachments

  • RuntimeRepro.unitypackage
    26.9 KB · Views: 1
After some headbashing, I developed a way to fully integrate UCC into the Adventure Creator prefab player system, save system, and general game workflow, for anyone interested that could have been trying to do that, can check their forums.
 
Top