Pickup Animation

plutonmania

Member
1 : Hello, you do not have Pickup animation in your Integration "Pickup Item" script.
I compared compared to the TCC version and the Pickup animation works well. And the text on the Object pickup is not there either. There is no reference with the UI Pickup as on TCC Demo. This may be wanted for the text of the action, but for animation, how to do your Demo integration version to make it work?

2: I would like to add after the same animation for the drop.
 
There are two types of pickups you can choose.

The UIS pickup: Inventory Pickup
image.png


The Integration pickup (built on top of UCC): Inventory Item Pickup
1682070278532.png


The UIS pickup doesn't have the ability to play an animation.

The Integration one (UCC) does have the ability to do so through the "Pickup" ability. The ItemId can be used to decide the animation to play. Learn more here:

The pickup animation can be changed here:
1682071313896.png



As you pointed out the Integration demo scene was not properly setup to pickup items. So I fixed it.
Here are some things to take into account:

The Pickup Item Definitions list must be empty if you want it to work on all items. If not you can define specific items that can be picked up with this ability. If there is an element in that list, but it is not the item you are picking up, it will not play the animation.

1682072529068.png

The layer is important, it must match the layer of your pickup in the scene. That was not the case in the demo scene for the Assault Rifle.
To make sure it works you can set the not pickup on trigger. And a prompt to pickup the item should appear:
1682072772825.png


I hope that makes sense.

For dropping the item you can set to drop using the UCC drop ability when possible. That will play the animation you've setup for that item
1682072870859.png

Unfortunalty there is no easy way to play an animation for the UIS drop or any UIS action. This is something we plan to add in the future, but it won't make the next update.
 
So thank you, I finally have the animation, it's great!

1: Before I used this method:

1 my old method.PNG

which allowed me to display a small panel telling me what object item was on the ground.
The panel is only displayed when I touched the object. No Sphere Collider, just the Collider box
But I did not have the little text of the action [F] and I did not have an animation pickup.

-----------------------------------------------------------------------------
2: Suddenly, I tried your method!

Great I have the animation of the pickup that is done :love:
But, I no longer had the panel, telling what objectItem is, and the amount (if is item bullets for exemple).

2.PNG

-----------------------------------------------------------------------------------------------------
3: I then tried to mix method 1 and 2 together. Even if I know there is a scripts rehearsal in the same genre.
It works, with the animation and the panel indicating that it weapon it is, but the panel does not fade as I would like once far away. He even remains if I am 200 meters from him.

3.PNG

-----------------------------------------------------------------------------------------------------
4: Then I tried to remove certain script which was repetitive.
The animation always works to meet, but the panel is always displayed when I am distant. Like for solution 3.

4.PNG

Resume :
If I find how to make the panel not displayed time that I do not enter the Sphere Collider, it would be perfect.
In the meantime, I resigned myself and I deleted the panel!
I prefer to have the (F) of the action and the animation and as once to pick it up it tells me anyway what I have picked up and the amount, it suits me.


-----------------------------------------------------------------------------------------------------
If in the future in an update, you make a system where we have animation + the text of the action + 1 panel saying that it is on the ground and its amount (if it is Ammunition for example, this offers an advantage, or not to take the item if it does not interest us, it would avoid having drop that afterwards)

And when I drop that the item drop, to put panel all that again:
(Animation + the text of the action + 1 panel saying that it object is on the ground and its amount) I would be in the angel.

-----------------------------------------------------------------------------------------------------
Thank you for your help anyway.
 
I reread what you told me:
Instead of Visualizer object put the inventory visualizer. --canvas with itemview linked to inventoryitemvisualizer But the same result, we see the panel from afar.
 
The Inventory Visualizer simply draws the ItemView.
To be able to show it when the character is ready to interact with the object, the pickup should know when it can be interacted with and send an event.
Unfortunatly I that's not the case yet. I will add that as a feature request and I'll try to add it by the next update since it seems to be something really useful to have.
 
Have you been able to make your changes compared to that " Inventory Visualize "?
The idea of the "item view" with the amount and super interesting also for, when you drop some ammunition of the pack ,This is acting in relation to the number of ammunition to throw and name in relation to the basic amount when it had been harvested at the start.

In the meantime I have created a small script , But without the "name and the amount" of panel, for try, to display a small action text above my item, thanks to my little GPT cat and it works. He uses the Tag Player and Active or Desactive if the player enters the trigger. I have delete " item view " in Panel, for make this with not error.
But I would already put it for the drops of ammunition which interests me even more than, to know the name of the Weapon, that II will pick up

C#:
using UnityEngine;
using TMPro;

public class ItemPickupUI : MonoBehaviour
{
    public GameObject pickupUi;

    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            pickupUi.SetActive(true);
        }
    }

    private void OnTriggerExit(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            pickupUi.SetActive(false);
        }
    }
}

My other concerns and that I use to pick up the weapons that the animation ("pickup item" works the system (inventory, inventory item pickup), it works very well now I have my animation for weapon.

But I do not know if you had already said or if I misunderstood, that only weapons can have the animation ...
but the animation only works to pick up the weapons and not the other style of Items (ammunition, clothes, resources, etc.). Is there a possibility of making this animation work for other items?
 

Attachments

  • 2.png
    2.png
    821.6 KB · Views: 1
Have you been able to make your changes compared to that " Inventory Visualize "?
I'm not sure towhat you are refering to. What I mentioned last time is that I would add a OnSelect OnDeselect unity event on the pickup such that you can use that to enable/disable a gameobject (in this case the inventory visualizer, but could be anything) when the character is close enough to interact.

As for picking up, non item pickup with animation.
On the pickup ability you can set the "Allowed Pickup" to "Other" isntead of Item

1683618346115.png
That will allow you to use a pickup animation for any kind of pickup.
Unfortunatly that will require you to create a custom component that inherits the IObjectPickup interface or the ObjectPickup base class (I recommend using the ObjectPickup since it already have a good base to build on).
Once you have your custom component you can put it next to your InventoryPickup component (for any item, not just weapon).
In that custom component you'll want to call the function to pickup the InventoryPickup.


Another option would be to "fake" it, by adding a HealthPickup component and then just making sure the inventory pickup and the health pickup happens at the same time... but that's more of a hack than anything else.

I hope that points you in the right direction
 
Yes, thank you it's exactly that i want .
I replaced "item" with "Everything" and I can finally pick up all my objects (for inventory (weapons, munition, clothes ...) with animation.
I am very happy haha .
Thank You ! ♥️
 
Hello I have a small problem that I would like to understand. I have created my clothes (Armor).
Category/Equipment/Definition ...
I have the animation to pick up The problem that I do not understand and that in the canvas, all the creation of clothes that I take and put in my inventory, there is a small "2" which appears below. While he only takes 1.

What could this be from?
1.PNG2.PNG3.PNG

I tested by taking 2 to see if he was added or put himself on another slot. He puts himself on another slot.

4.PNG
 
Perhaps the item view you are using has an ItemView module that shows some attribute value such a "defence" attribute stat?
The best way to figure that out is to find that "2" text component in the scene hiearchy and see if one of its parent object has a script that could be writing that value.
Then you can find what it is supposed to be and from there you can change the relevant ItemView prefab to make the changes you want.

PS: Make sure you aren't using a prefab from the demo scene, because if you update the package it will override all changes you made to assets inside the UIS folders.
 
Indeed I have the unit of Defense 2 (I'm sorry, this is obvious) having done it 1 month ago, I did not see where this little 2 came (heartbroken of my stupidity)

(I will read my project a little better next time) instead of bothering you)
 
Top