Quantcast
Channel: Questions in topic: "count"
Viewing all articles
Browse latest Browse all 187

many collisions while holding an item

$
0
0
Hello all, I'm sending a massage to the log file when I pick an Item with HTC Vive controller. in my log file I get this: Picked item, name : AppleRed at: 6/25/2017 5:43:17 PM Picked item, name : AppleRed at: 6/25/2017 5:43:17 PM Picked item, name : AppleRed at: 6/25/2017 5:43:18 PM Picked item, name : AppleRed at: 6/25/2017 5:43:18 PM Picked item, name : AppleRed at: 6/25/2017 5:43:18 PM I understand that it might be because it counts several collision per frame, while I hold the item with the controller, can this be fixed? I attach the script for reference. private void SetCollidingObject(Collider col) { if (collidingObject || !col.GetComponent()) { return; } collidingObject = col.gameObject; if (col.gameObject.tag == "Item") { LogManager.AddLine("\n\n" + "Picked item, name : " + col.gameObject.name); } }

Viewing all articles
Browse latest Browse all 187

Trending Articles



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