Hi I need create a combine system in inventory with drag and drop items on each other
I just want when player click and holding item-n1 and release it on item-n2 unity(c#) turn off item-n1 & item-n2 and turn on item-n3
How I can do that
Please at first offer me a tutorial video on YouTube
Thanks for sharing your science
I beg all of u please if know solution for my problem tell me
@OfficialCoatsee
@clunk47
@whydoidoit
@fafase
@aldonaletto
@Aurore
@Eric5h5
@Cyclops
@numberkruncher
@tanoshimi
@FLASHDENMARK
@FortisVenaliter
@SergeantBiscuits
OK, trying to be helpful here.
Simply perform your drag using the onMouseDown and onMouseUp functions ([link text][1]).
Then you can compare the colliders of the two objects in an onCollision event. ([link text][2]).
In there, you’re basically identifying which item collided with which other item. Once you identify it’s n1 and n2, then you can disable or destroy n1 and n2 and instantiate or enable/unhide item n3.
This is very basic. If you think about it, all you’re doing is what we do in Unity everyday! A missile collides with an item and both are replaced with a prefab containing explosion and shrapnel. Simple right? If you can see/understand how that’s done, then you’re going to do the exact same thing here. Item 1 collides with Item 2 (the mouse is released) and then both are replaced with Item 3.
Please let me know if this helps or not.
[1]: Unity - Scripting API: MonoBehaviour.OnMouseDown()
[2]: Unity - Scripting API: Collider.OnCollisionEnter(Collision)