Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created August 27, 2021 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unitycoder/63f12f9609c422bfcad79d907c602283 to your computer and use it in GitHub Desktop.
Save unitycoder/63f12f9609c422bfcad79d907c602283 to your computer and use it in GitHub Desktop.
Unity Boat Race URP Underwater Surface Flip & Reflections
// find line
Vector3 normal = Vector3.up;
// replace with
Vector3 normal = realCamera.transform.position.y < 0 ? -Vector3.up : Vector3.up;
// find line
var matrix = Matrix4x4.TRS(newPos + transform.position, Quaternion.identity, transform.localScale); // transform.localToWorldMatrix;
// replace with
var matrix = Matrix4x4.TRS(newPos + transform.position, Quaternion.Euler(0, 0, cam.transform.position.y < 0 ? 180 : 0), transform.localScale);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment