Unable to find the base object for item AssaultRifle. Ensure the item specifies a base object under the First Person Perspective Item component.

Item creation works and item is attached to correct bone outside runtime but this error occurs on play. I'm using UMA. I've tried specifying a variety of objects as the 'base object' without luck.

See video and screenshots.

1549

Code:
Error: Unable to find the base object for item AssaultRifle. Ensure the item specifies a base object under the First Person Perspective Item component.

UnityEngine.Debug:LogError(Object)

Opsive.UltimateCharacterController.FirstPersonController.Character.FirstPersonObjects:CheckActiveBaseObjects() (at Assets/Opsive/UltimateCharacterController/Scripts/FirstPersonController/Character/FirstPersonObjects.cs:340)

Opsive.UltimateCharacterController.FirstPersonController.Character.FirstPersonObjects:StartEquip(Item, Int32) (at Assets/Opsive/UltimateCharacterController/Scripts/FirstPersonController/Character/FirstPersonObjects.cs:310)

Opsive.UltimateCharacterController.FirstPersonController.Items.FirstPersonPerspectiveItem:StartEquip(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/FirstPersonController/Items/FirstPersonPerspectiveItem.cs:767)

Opsive.UltimateCharacterController.Items.Item:StartEquip(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Item.cs:402)

Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip:OnPickupItem(Item, Single, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:211)

Opsive.UltimateCharacterController.Events.InvokableAction`4:Invoke(Item, Single, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Events/InvokableAction.cs:225)

Opsive.UltimateCharacterController.Events.EventHandler:ExecuteEvent(Object, String, Item, Single, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Events/EventHandler.cs:522)

Opsive.UltimateCharacterController.Inventory.InventoryBase:ItemTypePickup(ItemType, Single, Int32, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:277)

Opsive.UltimateCharacterController.Inventory.InventoryBase:PickupItemType(ItemType, Single, Int32, Boolean, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:222)

Opsive.UltimateCharacterController.Inventory.InventoryBase:PickupItemType(ItemType, Single, Int32, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:194)

Opsive.UltimateCharacterController.Inventory.InventoryBase:LoadDefaultLoadout() (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:134)

Opsive.UltimateCharacterController.Inventory.InventoryBase:Start() (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:119)
 
Last edited:

Justin

Administrator
Staff member
Based on that video you are selecting RightItems for the base object which is part of the third person rig. You need to select an independent object for the base, similar to how this video uses the FirstPersonArms object:


Alternatively you can use FPS Mesh Tool - take a look at this page for more info on the first person arms setup:

 
Based on that video you are selecting RightItems for the base object which is part of the third person rig. You need to select an independent object for the base, similar to how this video uses the FirstPersonArms object:


Alternatively you can use FPS Mesh Tool - take a look at this page for more info on the first person arms setup:

I'm attempting to use UMA with UCC, thus why I don't have a separate model for the arms. Even if I were to slice the model using FPS Mesh Tool I don't believe I'd be able to skin it without diving deeper into UMA.

Ideally I'd be able to the full model, hide the head, and attach the weapon as though I was using a third person controller. Then just simply run a first person camera where the head is. I've been able to do the first part, but when I configure the camera to first person UCC throws a fit.
 
Even with UMA you'll need a separate set of arms. You can either create the arms dynamically using another UMA generated generic model or prebuilt arms. For UMA generated arms take a look at step 6 under Runtime Creation: https://opsive.com/support/documentation/ultimate-character-controller/integrations/uma/. It sounds like you really only need third person though, and then switch the materials when you zoom in.
I saw that but it says place in scene, not as a child, wouldn't the reference get lost on instantiation? If placed as a child UMA throws errors from duplicate bone names, it also tries to add bones from the arms UMA to the full body UMA regardless of naming. Edit1: I've found it attaches as a child after you place the object in the scene, so if you attach or don't it doesn't matter.

The easiest route would be to just run it as a third person and have the camera behave as first person. This doesn't seem possible though because the first person camera settings throws errors when the character isn't setup also as first person.

Edit1: I've followed the guides and videos using a standard model(not UMA) and I'm still getting the error described in the question topic. In addition, the arms are being attached to the camera properly but are not entering the default weapon state, meanwhile the third person figure is. The "Object" under "Render" within FirstPersonPerspectiveItem is pointing to the arms base, which is NolanFirstPersonArms.
 
Last edited:

Justin

Administrator
Staff member
I saw that but it says place in scene, not as a child, wouldn't the reference get lost on instantiation? If placed as a child UMA throws errors from duplicate bone names, it also tries to add bones from the arms UMA to the full body UMA regardless of naming.
UMA does throw that error, but that's ok and I haven't noticed any negative effects.

The easiest route would be to just run it as a third person and have the camera behave as first person. This doesn't seem possible though because the first person camera settings throws errors when the character isn't setup also as first person.
You won't be able to have a first person camera with the third person arms, but you can change the offset of the third person camera and have it mimic a first person camera.

Edit1: I've followed the guides and videos using a standard model(not UMA) and I'm still getting the error described in the question topic. In addition, the arms are being attached to the camera properly but are not entering the default weapon state, meanwhile the third person figure is. The "Object" under "Render" within FirstPersonPerspectiveItem is pointing to the arms base, which is NolanFirstPersonArms.
That sounds correct. The videos are accurate with the current version - just to be sure there isn't any left over code anywhere else can you try creating a new project and then follow along with the videos? Start with the project update, then scene, first person character, and then first person items. With these steps you should be able to get it working.
 
Top