"Less" operator behaving like "Less or equal"
I'm probably missing something really obvious, but I'm having an issue with this bit of code:
if (hit.transform.tag == "Interactable" && hit.rigidbody.mass < maxPickupWeight)
{
PickUpObject(hit.transform.gameObject);
}
My maxPickupWeight is set to 1000f, but I'm still able to pick up objects with a mass of 1000. If I set it to 1001, then I can't pick it up. It seems like the "<" operator is behaving like "<=". Shouldn't I only be able to pick up objects with a mass of 999 or less?
Obviously the simple solution is just to set the mass of objects I don't want the player to pick up to 1001, but I'd rather figure out what's wrong here.
Your answer
Follow this Question
Related Questions
Rigidbody - Force needed to cover distance within time, with drag 0 Answers
How would one go about implementing Unreal's Suggest Projectile Velocity function in Unity? 1 Answer
Prevent Transform Rotation to snap back to 0,0,0 when changing the Control Script 0 Answers
Checking whether player is standing on terrain or object,Checking if player is on terrain or object 1 Answer
Issue with child object collider moving through other colliders 1 Answer