Unity 3D + Playmaker - Runner Series - Making a Curved World using URP Shader Graph - Super Easy
In this tutorial, I'll use the Unity URP Shader Graph to make a curved world like Subway Surfer and then animate the curve using Playmaker . As an alternative to this Shader graph you can purchase and use the Curved World asset. ► Download Curved World at https://bit.ly/3JRmw9y (affiliate link) ►
This Runner Series entry creates the curved-world look seen in Subway Surfers using a URP Shader Graph that bends geometry based on distance from the camera, then animates the curve with Playmaker. Because Shader Graph ships with the Universal Render Pipeline, no extra package is needed. The result is exposed X and Y curve sliders your scripts can drive at runtime.
Set up the shader and its properties
Create a blank Shader Graph named road. In the Graph Inspector choose the Universal target, a Lit material, and a Specular workflow. Add two float properties, curve X and curve Y, each with a matching reference, slider mode, and a range from negative 1 to 1. Add a Texture2D property named Sprite for the road texture.
Build the curve in the vertex stage
Take a world-space Position node and multiply it by a model Transformation Matrix. Subtract the Camera position, then Split the result to isolate the Z distance. Raise that Z through a Power node (squared) so farther geometry bends more. Combine curve X and curve Y into a Vector2, divide by 100 to tame the strength, and multiply by the powered distance. Run that through an inverse-model Transformation Matrix, add the object-space Position plus camera position, and feed it into the vertex Position so the mesh visibly curves.
Wire the texture and apply the material
Add a Sample Texture 2D fed by the Sprite property and a UV node, and connect its color to the base map. Save the asset, switch the road material's shader to the new road shader, and assign the road sprite. Dragging the curve X or curve Y sliders now bends the road live in both axes.
Animate the curve with Playmaker
On the game manager add an FSM named Road Curve Anim. Tween a curve X float from 0.004 to negative 0.04 with an ease-in-ease-out, looping as a ping-pong over two seconds. Because the tween only changes the variable, add a Set Material Float action on the road material targeting the curve X reference and update it from the tweened value. Now the road sways left and right on its own. In a real game you would stretch the duration much longer or trigger it at intervals, but the short loop proves the shader animates correctly.





