|
I want the player to pick up an item if pressing a key and colliding with it. is OnCollisionStay in the player class the way to go? In the player class I would reference the Inventory which has an AddItem() function. would it be that simple? thing being a GameObject var from the "other" object.
(comments are locked)
|
|
loose a if statement and combine them in one statement if(input.GetKeyUp(keyCode.e)&&other.tag == "Item"){Inventory.AddItem(other.thing); this will save on some computing also switching to the GetKeyUp is the right route for what you are wanting to accomplish.
(comments are locked)
|
|
The first parameter of OnCollisionStay is Collision not Collider.
(comments are locked)
|

Thanks guys, I'm an artist working in a programming vacuum. It helps a lot to just get some feedback