- Home /
Where can I learn to do this?
Hey I need to learn how I can make a tool for unity that dynamically creates meshes. For example, If I wanted to make a ladder taller, I can drag the top part of the ladder upwards and the ladder would extend AND add more rungs to it. I want to be able to quickly paint objects into the scene with this tool. (I want to create a level editor). How can I do this?
Answer by WhoRainZone1 · Aug 08, 2014 at 12:14 AM
For your example of a ladder you'd need to separate the vertices of the two long rods' and the smaller ones, the ones you actually step on. Then you can go on to calculate the ladder's length.
You iterate trough that lenght by lets say 10 units - the distance between each of your ladder steps. By that you have the positions where your ladder steps are and can therefore place the set of vertices accordingly.
The outer rods's vertices are simply calculated by the start and endpoint of the ladder.
If you have no clue at mesh generating at all, I'd suggest you fiddling around with it a bit, that ladder should be quite a good example, but I'd hold it simple at first and use square and no round components. :)
Links you should get a look at:
Yes the ladder was an example. I want to be able to edit meshes through the editor using custom tools. I dont think this covers on how to actually create the tool in the editor. Thanks for that awesome answer though
Ah okay, I thought you were talking about using that ingame.
This and this should be something for you.. you can set parameters how you need em (ladder height for example), or fix the object's size via a button for example, so you don't mess with it accidently.
For visuals and responsiveness in your editor window I strongly recommend just going through this site.
Hope that helps, WRZ
Your answer
Follow this Question
Related Questions
How to check if object is skewed ? 2 Answers
How to assign object reference to ObjectField knowing the object's name? 2 Answers
ScriptableObject problem 1 Answer
Using scene editor to edit stored data 0 Answers