I have a simple function that returns bool
value as a result of comparison of distance between 2 entities to GravityRadius field.
public bool IsEntityPulledByGravity(IEntity entity)
{
return Vector3.Distance(State.Position, entity.State.Position) <= GravityRadius;
}
Sometimes it works as it suppose to but sometimes it returns incorrect false
value. I entered debug mode to analyse it and I can't figure out why it would return false for comparison of 30 <= 30
. What am I missing?