Quantcast
Channel: Latest Questions by RoboticSarcasm
Viewing all articles
Browse latest Browse all 40

Code not doing anything

$
0
0
Hello everybody, i modified a piece of code that i found for an inventory system, and after i changed it it doesn't work anymore. The only piece of code that was modified was the following: function OnCollisionStay(col : Collision){ if(!collider.isTrigger){ if (Input.GetButtonDown("TakeItem")){ var playersinv=FindObjectOfType(Inventory); playersinv.AddItem(this.transform); MoveMeToThePlayer(playersinv.transform); } } } It should make it so that whenever i press E it picks up the item and puts it in my inventory but it does absolutely nothing. Does anybody know how to fix this? PS: i know that this is some very shoddy coding, still learning.

Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>