Skip to content

Commit

Permalink
let dimers bond into rings even if they have to move just outside the…
Browse files Browse the repository at this point in the history
… tank
  • Loading branch information
neon-ninja committed Mar 14, 2018
1 parent 4193bc6 commit e42eb26
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Assets/Fishtank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,9 @@ void PushTogether()



if (!bounds.Contains(go.transform.position))
if (!bounds.Contains(go.transform.position) && tag != "dimer")
{
// monomer/dimer/ring is outside tank bounds
go.GetComponent<Rigidbody>().AddForce(Vector3.Normalize(bounds.center - go.transform.position) * Time.deltaTime * Random.Range(0.1f, 0.5f), ForceMode.Impulse);
go.GetComponent<Rigidbody>().AddForce(Vector3.Normalize(bounds.center - go.transform.position) * Time.deltaTime * Random.Range(forceTankMin, forceTankMax), ForceMode.Impulse);
}
}
}
Expand Down

0 comments on commit e42eb26

Please sign in to comment.