Skip to content

Instantly share code, notes, and snippets.

Ilya "Guest" Plotkin GuestEG

  • Russia
Block or report user

Report or block GuestEG

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:e3b82a584f691199da3dc50e839550c7
public float snapValue = 0.5;
public float depth = 0;
void Update() {
float snapInverse = 1/snapValue;
float x, y, z;
// if snapValue = .5, x = 1.45 -> snapInverse = 2 -> x*2 => 2.90 -> round 2.90 => 3 -> 3/2 => 1.5
You can’t perform that action at this time.