How to get a reference to dropped object after call item.Drop

Kirshor

Member
Hi,
I wish the class Item.cs has a methob similar as below:
GameObject droppedObj=item.Drop();
I need to get the droppedObj to do something on it.

What is the best way to get a dropped object like that.

Thanks
 
Unfortunately Item.cs does not have a method to do this directly.

Look for the following line in Item.Drop:

C++:
var spawnedObject = ObjectPool.Instantiate(m_DropPrefab, dropPosition, dropRotation);

spawnedObject is what you're looking for.
 
Top