Daily progress — Setting up the skeleton using the shared enemy class.

Esteban Ibarra
2 min readAug 12, 2021

--

So let’s create the skeleton Enemy!

Create an empty, zero it out, drag the first idle frame into the empty, make sure that’s at position 0 as well, set it at sorting layer 50 and we’re ready for step 2!

Select the idle frame, rename it “Sprite”, create a new animation while it’s selected, save it as “Idle” in its proper directory, drag all the idle frames into the timeline, set the timeline samples to 25 and we have an idle animation!

Finally in the timeline, we create a new animation and call it “Walk”, drag the keyframes in and set the samples to 25.

Select the animator window, create a new trigger called “Idle” create transitions from idle to walk and vice versa. From Idle to walk, has an exit time, 0 transition duration. From walk to idle, condition is the Idle trigger, no exit time, 0 duration.

Attach the script to the skeleton set the speed, set up the waypoints, and watch it go!

Oops, it did its idle twice, let’s set the walk as the initial state.

Seems like I didn’t save the scene last time as the moss giant lost his waypoints. I quickly fixed it.

Now we have 3 enemies with unique walking distances but all using the same base script! That’s really awesome!

--

--

Esteban Ibarra
Esteban Ibarra

Written by Esteban Ibarra

cartoonist, game artist, and wanabe gamedev.

No responses yet