Errors when integrating user model with BT and UCC

Weiprecht

New member
Hello all,

I am attempting to template the EnemyAtlas prefab with my own model mesh. I am trying to set them up exactly the same. I am using a model that works fine with the UCC controller. As both the AI and the controller are supposed to be built on the same framework and use the same abilities. However, the AI using my mesh is not transversing the Namesh correctly. It is moving slowly and gets stuck on the waypoints or doesn't reach them even though both models are using the exact same values and the same Demo animator. Every script is the same. Can you help me understand why this might be happening? I want to have my models working with the EnemyAtlas setup so that I can experiment with the different BT tasks and branches. Your advertisements are all about quick prototyping so I expected this process to flow better.

AgentsMoving.jpg

I am also getting the following error log.

Error-log.jpg

Thank you for your assistance.
 
Hi, first of all the Lean and Item Pullback errors are likely related to your player. Check the colliders used by these abilities and compare with the demo player's setup.

Next, it's hard to help with the first four errors without being able to read the whole stack and source at the bottom of the console. You can also click once on any of these and see if Unity pings the object causing the error in the hierarchy. Btw I highly recommend getting Editor Console Pro which is currently on sale, it offers a much clearer console and the possibility to directly copy the stack and source.

Can you check if the tasks used for pathfinding in the BD tree are properly setup with the right targets ? Could you also try making a character from scratch with your model without using the template feature ?

Lastly I can offer 30m of screenshare for free to directly look at your AI character, you can DM if you're interested. Hope this helps !
 
Thank you, Cheo. For the Lean and Item Pullback errors on the player the colliders are identical in both the Atlas Template and the Atlas Demo. So I am not sure where those errors come from. That being said, the nullReferences and the Missing referenceException maybe related to having not set up the weapons IK yet as I am most interested in the AI possibilities. Those same errors appear in the initial character setup using the Atlas template.

The AI character does not have a lean or item collider similar to the EnemyAtlas. So, you are right that the errors are related to the character.

All that being said, there does not appear to be an explanation as to why the AI character is moving slowly in game. The NPC is simply inching along as compared to the EnemyAtlas. And if I add my model mesh to the Enemy Atlas, it does the same thing. Nothing makes sense.

Update: On the Capsule Collider Positioner (Script) if I turn off the Adjust Height parameter, the NPC moves at the correct speed, but the mesh has its feet at the center point of the collider. When I adjust the Height Overrise to -0.5 the collider sinks to center. My model is still floating above the plane, which is likely preventing it from hitting the minimum stopping distance of 0.1 on the Nav Mesh Agent.

AutoAdjustHeight.jpg AdjustOff.jpg HeightAdjust.jpg

Is this a bug in the auto adjust of the height on the Capsule Collider Positioner? Any ideas how to fix it?
 
The Lean and Item Pullback abilities shouldn't require weapon IK to be used nor even implemented. You should just make sure that you do have a capsule collider under the model's Colliders object for the lean and another for item pullback, the latter should also have an Item Pullback Collider component attached. The error suggests that the colliders you're using are not of type sphere nor capsule, so check all of that and make sure they are dragged into the respective abilities and it should work.

Capture d’écran (3399).png

Capture d’écran (3400).png

Capture d’écran (3402).png


Next, could you please share a close up on your AI character with the initial settings for his Capsule Collider Positioner ? You can also try enabling Adjust Height which is active on the demo character. Lastly, if you still can't figure it out, I strongly recommend making a new character from scratch without using the template feature.
 
Thank you, Cheo.

I did double check the itempullback and the lean on the Player and it looks like I left the second size slot blank in the colliders and this was indeed causing that particular error. Good catch!

In regards to the AI model, these are the current settings and how it looks in game. Note that with the Adjust Height disabled I can get normal speeds and movements but still have some floating.

CapsuleCollider.jpg AdjustOff.jpg

When I run it with the Adjust Height selection clicked, it looks like this and has very slow movement and get's stuck on the waypoints.

AdjustOn.jpg AdjustOn2.jpg

As you can see here with the entire character selected, the AI is also floating above the floor. I tried to adjust the base offset in the NavMesh Agent but it appears to be overwritten by the code. I also don't know where that box collider comes from on the lower half of the model. The EnemyAtlas does not have that box collider, nor does it have the same problem with the collider on the CapsuleColliderPositioner.
baseoffset.jpg

Thank you for your assistance. Also I like your videos on your YouTube page. Very interested in the BT video and what you are trying to achieve.
 
Hey, I gotta go to bed right now but here is what I can say :
-First, you will naturally have to find and figure out what this box collider is. Just locate it in the hierarchy and see what component it has attached, feel free to share a screenshot.
-Could you drag your soldier model into the scene, select it with the pivot mode set to local and see where the 3 arrow gizmos are positioned ? My suspicion here is that your character's pivot is not located on his feet, and if it is the case then that naturally has an impact on the collider since his root is dragged into the First End Cap Target slot.
-Lastly, I'm glad to hear that you got the lean and pullback issue fixed, and that you like the work on my YouTube channel :)
 
Back
Top