Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Unity 2D Spline Terrain
- Created by Chevy Ray Johnston
- @chevyray | [email protected]
- =======================
- Download here: https://dl.dropboxusercontent.com/u/1532933/Spline.zip
- To use:
- 1. Have a "floor" texture material ready to go
- 2. Import the package, you will get 2 scripts (Spline.cs and SplineEditor.cs)
- 3. To create a spline, go GameObject -> Create Other -> Spline
- 4. This will create a simple 4-point spline, but it will be invisible, so now drag your
- "floor" material onto its MeshRenderer, so it knows what texture to use
- 5. Now you should see your spline. To edit the spline, switch to the View Tool (Q),
- and the spline control points will appear
- 6. You can create new control points with the [+] buttons and delete control points
- with the [-] buttons. The two control points at the end are for controlling how
- the spline ends.
- 7. A MeshCollider is automatically generated, it will be a child object of the spline
- 8. Try playing around with the various properties on the Spline component to see what
- they do, I probably named them badly. I usually set "Pixels Per Unit" to the height
- of the "floor" texture in pixels, so that 1 Unity unit == 1 full height of the texture,
- but you can tweak this to your liking.
- 9. If the collider is too beefy, try increasing the "Segment Length". This will make the
- ground a bit chunkier, but will alternatively make the collider simpler.
- Feel free to email me if you have any questions. This is just a little toy I created in like 6 hours,
- so if you're going to use it in your game, BACK IT THE FUCK UP first, I don't want to be responsible
- for breaking your project if this thing has horrible unforeseen errors or anything.
- Peace.
Advertisement
Add Comment
Please, Sign In to add comment