Trouble with Rewired

Tarball

New member
I can't seem to make third person controller work with rewired. I downloaded the integration kit, and I place "Rewired UCC Input Manager" in the scene and removed the event system, but I still get errors that countless abilities are not explicitly listed in Unity Input Manager. I'm a little confused, because of course they are not listed in Unity Input Manager.. they are listed in Rewired Editor. How can I make TPC detect this? Thanks
 
I found the problem. UMA was adding the Unity Input Script at runtime. Thanks for pointing me in the right direction.

The thing is, I'm not sure how to prevent this behavior. I'm using the UMA Character Builder script included in UMA integration.

Edit:
I commented out line 168 of CharacterBuilder which is called from UMACharacterBuilder, adding the UnityInput component. Now, however, the reference to m_CharacterLocomotion is not set to an instance of an object in UltimateCharacterLocomotionHandler. What should I do?

I followed the instructions on
exactly.
 
Last edited:
I commented out line 168 of CharacterBuilder which is called from UMACharacterBuilder, adding the UnityInput component. Now, however, the reference to m_CharacterLocomotion is not set to an instance of an object. What should I do?
I would need the stack trace to get a better idea but you should add RewiredInput in addition to not having UnityInput.
 
Yes of course I have been adding rewired. The problem is that when using UMA and Rewired together, your UMA integration wants to add and use native Unity input. That's why I commented out that line -- to prevent it from adding it. However, now I get these errors.

I would need the stack trace to get a better idea

Here is the stack trace after commenting out aforementioned line:

Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler.GetDeltaYawRotation () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:196)
Opsive.UltimateCharacterController.Game.KinematicObjectManager+KinematicCharacter.FixedMove (System.Boolean manualMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:200)
Opsive.UltimateCharacterController.Game.KinematicObjectManager.FixedUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:751)


NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.CharacterFootEffects.FixedUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterFootEffects.cs:279)


NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler.Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:71)


The second and third errors spam the console repeatedly. Please help.
 
Is that the first error? I would have expected one before that within Awake or Start.
 
Try importing the updated UMA and Rewired into a new project with TPC, and you'll see what I mean. Yes, the first error I listed is in fact the first error output to the console when I press play. However, it is the 1st and 2nd errors that are repeated, while the 3rd error prints only once.

Here is what I have done so far and where I am stuck.

1) Comment out line 168 of CharacterBuilder.cs which is called from UMACharacterBuilder.cs, adding the UnityInput component.

2) Change GetCachedComponent to GetComponent on line 49 of UltimateCharacterLocomotionHandler.cs, so it reads:

Code:
m_CharacterLocomotion = m_GameObject.GetComponent<UltimateCharacterLocomotion>();

in the Awake() method.

3) Do the same for line 115 of CharacterFootEffects.cs.

This works because UltimateCharacterLocomotion.cs is in fact attached to the gameObject.

Okay, now we just get one error, but it occurs every frame of FixedUpdate().

Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.ThirdPersonController.Character.MovementTypes.Adventure.GetDeltaYawRotation (System.Single characterHorizontalMovement, System.Single characterForwardMovement, System.Single cameraHorizontalMovement, System.Single cameraVerticalMovement) (at Assets/Opsive/UltimateCharacterController/Scripts/ThirdPersonController/Character/MovementTypes/Adventure.cs:73)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotionHandler.GetDeltaYawRotation () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotionHandler.cs:196)
Opsive.UltimateCharacterController.Game.KinematicObjectManager+KinematicCharacter.FixedMove (System.Boolean manualMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:200)
Opsive.UltimateCharacterController.Game.KinematicObjectManager.FixedUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:751)

Line 73 is referring to
Code:
                Quaternion lookRotation = Quaternion.LookRotation(m_CharacterLocomotion.LookSource.Transform.rotation *

in case I changed anything. Please give me a solution next time. We are going on day 3 here...

It looks to me that none of the base classes of Adventure.cs are attached to the gameObject, so m_CharacterLocomotion in not referencing a gameObject.
 
Last edited:
Please give me a solution next time.
He can't give you a solution if he doesn't know if it's the first error, the second, or the hundredth. Besides, Justin's got a lot of stuff on his plate so to expect a solution on a dime is unfair, especially when it's issues like this that are very selective usage cases (from what I've seen, we've only got a few people actually using UMA + UCC).

Please attach the debugger and set breakpoints on the functions that are shown in the stack trace. One of the functions is returning a null, or trying to grab data from a null object. But which one is it? That's why using the debugger to halt execution when you trip a breakpoint will allow you to see what's being fed into the scripts and identify the culprit.

Then come back to us with your findings and we'll go from there. :)
 
Okay, I think I might have encountered the same issue here. Check if your character has a Local Look Source attached to it. If not, attach the script. This solved the issue for me - for some reason UCC 2.1.7's Character Wizard didn't add the script for some reason.
 
Yeah, I don't think so. I'm pretty sure it is as I said earlier that
m_CharacterLocomotion in not referencing a gameObject.
in Adventure.cs
If you look back to the base classes, there is no getcomponent in awake or start for m_CharacterLocomotion.

I don't want to do some Find(tag="Character") hack if there is a better way, but I don't know the code here.
 
Before I go any further, maybe I should ask if TPC has a movement type similar to dark souls or 3rd person skyrim. It looks like it's just "third person adventure" and "third person combat." Forgive me for not reading the 300 page manual.

I may be trying to force a square peg into a round hole here, and I might be better off rolling my own. It seems like a great product, if I could get it to work. The animations were worth the price alone though.
 
With those types of errors generally there is an exception within awake or start and people don't post the first error so that's why I ask.

If there is an error within GetDeltaYawRotation then that means that the movement type doesn't have a look source. Related to what Matt said, did you attach the character to the camera? This post has a similar stack trace:


If you are using the runtime creation version of the UMA integration then it has the option automatically assign the camera after the character is created (step 4 of the runtime creation docs). You can assign the character manually with CameraController.Character = character:


Before I go any further, maybe I should ask if TPC has a movement type similar to dark souls or 3rd person skyrim. It looks like it's just "third person adventure" and "third person combat."
Combat, Adventure, and RPG movement types are the only third person movement types included. If one of those don't fit the style that you are going for (nor do tweaking any of it's parameters), then you can extend the movement/view type to get the exact logic that you're going for. This is easiest to extend by copying a movement/view type that is most similar to what you are wanting and then going from there.
 
If one of those don't fit the style that you are going for
Thanks Justin, I think I'll just roll my own then and use Ootii's camera system. I think it will be faster and less of a headache. But for future reference, the UMA integration only works with native Unity input. When you try to add Rewired, it all breaks down. Cheers.
 
I'm having a issue with using a touch joystick (Custom Controller) for the movement. I know that Rewired is working but I have added a button for the jump and I can jump with the touch button from Rewired. Is there some type of setting I'm missing with the joystick?

Rewired.PNGRewired-b.PNGRewired-c.PNG
 
I'm sorry to have bothered you but Rewired and UCC is working like normal. I have figured out what the problem was. I was using a Windows Remote Desktop while I'm fixing my main computer. There was no translate between the remote computer to the host computer. That's why it wasn't moving. Once I built the project and played the game on a Windows tablet I was able to move the character.
 
I'm using Unity 2019.3.9f1

I have upgraded the Version 2.2 of UCC and I'm running into issues with the mouse. I have attached the Rewired component to the player and input manager to the scene. When I press escape the mouse doesn't show up and then you can't move the player look around. So I decided to start from a clean slate.

I have created a new scene then copy/pasted Nolan from the demo. Removed the Unity Input and attached the Rewired Input component. As well drag/dropped the Rewired Input Manager into the scene as well. I built the scene and ran it. First load the player is controlling correctly but as soon as you press escape the mouse doesn't show up and the player is no longer responding to the mouse input.


RewiredInput.PNG

When downloading the Rewired Integration package, are they the same or do you need to choose the correct one?

1587072296379.png
 
Last edited by a moderator:
Top