Created
August 27, 2021 16:27
-
-
Save unitycoder/63f12f9609c422bfcad79d907c602283 to your computer and use it in GitHub Desktop.
Unity Boat Race URP Underwater Surface Flip & Reflections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// find line | |
Vector3 normal = Vector3.up; | |
// replace with | |
Vector3 normal = realCamera.transform.position.y < 0 ? -Vector3.up : Vector3.up; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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