Have you ever tried to create an extensive fence or curvy hose in your Unity scene? Scabrous task: the best way to do this till now – open up your 3D editing program, load a straight object and deform it roughly to your scene. Bored from limitations on objects length due to inability to place it on hilly landscape? Now you got the solution!
SplineBend allows you to deform your object, causing it to take the form of a spline. With the help of this script you can create create perfectly bended objects directly in your Unity scene.
Add object you want to deform to your Unity scene, and add SplineScript component to it. On both sides of the object two primary markers will appear. Place the markers to the desired trajectory. In order to move the marker – highlight it by clicking and drag it the same way as an ordinary game object. To add a marker – Ctrl-right click on the line between the markers. To delete a marker – just select it and press Delete key.
You can use different marker types:
- smooth automatically creates a smooth curve between two adjacent markers;
- transform sets the spline direction by transform rotation and smoothness by transform scale;
- beizer or beizer corner allows to configure spline manually with handles;
- corner always creates sharp corners without smoothing.
This tool allows you to create object of almost any length by tiling an object – just like a texture – the object geometry will repeat itself the stated amount of times.
And besides, SplineBend allows level-designer to bind object to terrain or any other mesh with collision. Binded object would follow all terrain curves and slopes. This is extremely useful for creating roads or decals.
- time economy and quality improvement as compared with deforming objects in 3D editor;
- possibility to create roads or other long decals: see the video;
- and you can place objects no one else has!
- bended object must have only 1 material;
- and not more than 65k vertices.