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);
}
}
↧