NokiMo
taxiderby
taxiderby

patreon


Guide: Character Path Editor

Before we continue, this guide assumes you have the newest version of the Senza Pack, but if you don't/aren't using it, you'll need to quickly made a "CharacterPath" script, which contains a public Vector2 list called "pathNodes."

So, in this case, you can add a "CharacterPath" component to an object, but you can't see the waypoints themselves, which is a real pain when you'd like to know what you're DOING. So let's fix that!

First, make a "Editor" folder, make a "CharacterPathEditor" script inside it, and open it up.

This is a great start if we were making a normal component, but we're not! So we're throwing about half of this in the garbage immediately!

But before we go any further with OnSceneGUI(), we need to put together a very important function: ShowPoint(). This handles how each point is presented and allows it to be grabbed and dragged around.

Let's head back to OnSceneGUI()!

Let's return to OnSceneGUI() once again.

We can still do just a bit more! Down in the ShowPoint() function, let's add this after "point" is defined~

And we're done!

Thank you so much for waiting! If you have the Senza pack, you can try this out immediately with the Path Tester script. The raw files (with some additions) will be provided to the Mischief Maker and higher tiers very very shortly.

Guide: Character Path Editor

Comments

I love how to the point these are. Something I had a lot of trouble with when I was trying to learn Unity was finding tutorials that were a midway point between basic programming concepts and walking through already completed projects. Having some basic editor scripting explained in bullet point format is incredibly useful and I wish these were more commonplace.

Mint


Related Creators