Drop Item View

plutonmania

Member
Hello, I would like them to explain to the creation of a DROP different for each items. I spent the night and today making multiple try. The only time I succeeded it is in the item collection to add the "droppable" category to the category 'single wield gun' to bring up a prefab of my drop, to replace the "bag item drop" which does not does not interest me.

-----> my goal and that I would like to throw my inventory, the visual of my item and not a bag. and let it be on the ground, that it touches the soil, (not in the air)

-----------------------------------------------------------------------------------------------------
Test 1:
by adding the "Droppable" category to the Category 'Single Wield Gun', this is the only way that it makes me appear my item (Assault Rifle) in this case for my tests. I put the assaultriflemodel there and I see my weapon well by depositing it. But I had put the model on the ground, unfortunately it is standing (another problem for me).
2 pickup object.PNG1 item definition.PNG

Test 2:

I also try to add a canvas with panel so that people see on the ground, the name of the item in addition to the [F] button. I believe that I had had a moment, but after a new test, more visible object, or the object fell from the ground, even with a rigid colider, a colider box
v2 drop.PNG

Test 3:
I remove the Category Doppable from the Category 'Single Wield Gun', which was no basis for this test, to return by Default. I checked on the model of my weapons with the character item the object crest drop item with in just the 3D model (without panel test). And have checked in Character inventory bridge the box: drop using character item when possible, assuming that he would go and get the drop item from my configured weapon (like your variant assaultrifle) to give you an idea) but no I have the bag which appears when I place on the ground.
drop.PNG
last.PNG

test ... : 'I also tried by sliding my pickup in the category in the model in the model., It worked but he gave me after the 3rd time of the duplicate of my weapon
-----------------------------------------------------------------------------------------------------
-- I read the subject on the drop : -- > Here

-- This person also talks about it, but dont understand completly: -- > Here

-- But still no object with the panel, he becomes invisible and marks me 0 I tried to adapt to this tutorial: Video opsive tuto

I am lost far too much test to succeed in the first time, to have my model, unfortunately not glued to the ground but in the air and no panel, when it would be like that I would like it. :)
-----------------------------------------------------------------------------------------------------

Can you show me a pickup weapon model with panel and weapon glued to the ground. And how to configure his drop, so that it is the weapon that appears when I remove it from the inventory and there is the little panel appearing at the top of the weapon throwing.

Thank you if you have time for this demonstration. Being French, the video are harder to understand
I bet it is simple, but I have the brain in spinition by dint of finding the perfect method for that :)
 
Last edited:
No problem.
I'll try to explain a few things more just to give a bit more context.

There are two Item Drop options. The "UCC" (Ultimate Character Controller) way and the "UIS" (Ultimate Inventory System) way of dropping items.
We'll call "UIS" way option 1
and "UCC" way option 2.

1680530589844.png

If you want the most flexibility and scalibitlity you'll want to use Option 1 (UIS).

Option 2 allows you to define the pickup/drop on the Item prefab:
1680530750716.png
This will allow you to drop the item as you have defined it here, But it will use the UCC ItemPickup script on that prefab. That's not what you want since you said you wanted the pickup with a little panel that gives information about the item. This also only works of UCC weapons and not other types of items.


So Option 1 is the way to go for you.
This will use the InventoryItemPickup prefab that you defined in the CharacterInventoryBridge (first screenshot) to drop the item. The item dropped by default will be the one that looks like a bag. But you can customize that using an "Inventory Item Visualizer" component. This component allows you to dynamically change the visual of the object dropped by getting the prefab defined in the Item Attributes. Learn more here:
So so far you'll have two prefabs:1 is the InventoryItemPickup and the other is the visuals of the item.

If the dropped item looks like a bag, and not your item, It's because you haven't set the "InventoryItemVisualizer" component properly on the inventoryItemPickup, or you haven't set the "VisualPrefab" Attribute on the Item properly.

You said you wanted the item to stay on the ground and not float. For that you'll want to follow those steps:

1) Have a Rigidbody on the InventoryItemPickup prefab with some gravity
2) Have a Trigger collider in the InventoryItemPickup, this will defined from how far the item can be pickedup
3) Remove any non-Trigger Collider from the InventoryItemPickup, This will make the pickup not collide with anything
4) On the "visual" prefab in the Item Attribute, add a collider that has the size of the item. This will prevent the item from falling through the floor and make it look like its on the ground.

Finally you said you wanted the little panel to showup.
For that you'll need to have a canvas with an ItemView inside and link it to your InventoryItemPickup to show the contents of the pickup.

I hope all of that makes sense. Best of luck
 
Thank you, as always for taking your time!

So I was able to redo tests since and I am doing quite well. I used the model that you offer for ammunition, as a pickup model. ?
But I changed the bag model directly with the Assault rifle (M4, For Me), to be able to make the Collider box to its dimensions and not that of the bag. Even if I put in the visualizer the name of the model has shown.

  • Test V1 :
So I added to the category "Single Wield Gun" La Categorie "Droppable" to have the object that I want instead of the bag by Default, once I take the item from the inventory. He takes me out my model of weapon, and as I had in advance already returning to 90°, he is no longer standing but finally lengthen! Good.
1_pickupItem.PNG

The only thing now and is it possible once I put the weapon on the ground after having thrown it that it is the panel that re appear. Unfortunately it only shows my model without the visualizer. When I put the M4_Drop (which is only my model without a script).

2_drop.PNG

  • Test V2 :
Suddenly I tested a second that makes it possible to do it, by directly putting my M4_Pickupv2 in the category "Droppable),
3_drop V2.PNG

but it gives me my weapon in duplicates.

4_Droptest pickup.PNG
  • Test V3 :
Ok so I have recreated an M4_Dropv2 on the model of my m4_pickup_v2 and I remove all the Collider script so that it looks like the M4_Drop 1, but I am leaving the panel. I was almost there ......
--- > the only problem and that it did not display me a weapon it puts me 0 and therefore made it disappear.
5_bugdropv2.PNG
I know I'm almost there.
 
So I think your issue here is that you are trying to set a Pickup inside another pickup.

The structure I usually recommend is 2 prefabs
1) InventoryItemPickup prefab:
-InventoryItemPickup (with InventoryItemVisualizer, Rigidbody)
--DropPrefabParent
--Trigger collider for pickup
--Canvas with itemView linked to InventoryItemVisualizer

2) Drop prefab:
-EmptyParent (no script)
--Visual prefab of the weapon (no script)
--Collider for collisions
So when the item spawns you get prefab 2 inside prefab 1 under the DropPrefabParent.


But if your setup works for you that's fine too. There is no "one" way of doing it
 
Good morning,
So I test your method which is for inventory item AND the other method with item object (copied from your pickup, for your ammunition bag).

--- > I have always left in my category attribute the "droppable" category in all my category calling on my weapons or ammunition (Ammo, Melee Blade, Single Wield Gun, Shield, Arrow).

--- > I prefer the 'item object' method I make fewer errors, even if I find that it is like. I do my drop like that because like that I can either drop with the inventory panel, or drop with the 'y' of Ucc.


My goal is always to have the panel when I drop the object with its amount deposited and not predefinit.

Everything is working very well! On leaving the new amount of the panel.
The only problem and that for the ammunition thrown, like sometimes I throw more than 1, it only marks me the value I put in the "item object" and not the new amount deposited.
--- > (I know that in your explanation you say for the (item drop prefab) not to put any scripts on the collisionrs, but when I do that I have no panel for the drops.
For weapons this poses no problem that they are on 1 since we cannot deposit more than one weapon at a time, so my panel appears well with the name and the amount of the weapon when I drop it.

But when it comes to deposit several earth ammunition (in 1 items suddenly), it always marks the value I had put (1 or 12 or 48 ....). If I take them again, it tells me very well the amount to recover. If I threw 8 I recover 8 even if I defined the 'itemobject' of the 'drop prefab' on 1.

My question is how to make the Dropper ammunition panel displays the number of ammunition placed on the ground well ?

I still give you the captures to show you my item pickup and my item drop. I am sure that it is at the level of the amount of the object defined in "item object" of my Drop object.
1_pickup munition.PNG3_drop munitions.PNG

PICKUP ITEM
A-B.PNG

DROP ITEM
C drop.PNGend.PNG


Otherwise my solution would be to deactivate the text 'amount' for the drop.
 
Top