ANIMATION AND RIGGING - SOLVING MY 3D CHARACTER GLITCH

avatar
(Edited)

boy_scene_banner.jpg

I can now say that I'm fully satisfied with my first street tile, the graphics looked so much better compared to the previous version I did, maybe it's cause I used Unity 2015 but I think it is because of the poor understanding of colors and textures that I previously had, I was chasing realism, instead of keeping it simple.

st_1.jpg

First things first, I had to clean up my scene, after creating a bunch of 3d assets(cylinders, cubes, rectangles, polygons) in the project hierarchy, I had to group them together in a singular tile to finally form the first tile that would be spawned during the game run.

st_1a.jpg

Now that I've grouped it into a single prefab, I am now much relaxed, felt like I just cleaned my room 😆... time to move on to other things.

FREE AUTOMATED RIGGING AND ANIMATION

Game Dev is a very broad subject and it's very easy to waste time on animations, There are free resources that can help reduce this difficulty... unless you are creating a custom game mechanics that require custom rigging.

One of such free resources is called mixamo You only need to upload your 3D models into the system and then you can download fbx animations based on that 3D model.

st_4.jpg

After uploading my already finished 3d model, I just had to download the fbx animations I needed. My game only needs simple animations like (running, sliding, jumping, etc)

THE GLITCH

After downloading my custom rigged model from mixamo, I observed something strange happening with my model.

st_6b.jpg

A minor issue was that mixamo re-scaled my model, It became a giant when I imported it into unity but that can be easily fixed in the unity inspector panel.

The only thing that worried me was that; One of the shoe is transparent! At first, I thought it was a unity UI glitch, sometimes when you zoom in too much you start to see the opposite side of the mesh, like a back culling thingy.

st_4a.jpg

But I troubleshot it further and applied a simple material to this invisible foot and saw that it was black like a shadow, now I knew that something serious happened to the model.

I even when back to mixamo and tried to use an (.OBJ) model instead of an (.fbx) one but it was still the same issue.

THE PROBLEM

After taking this mixamo corrupted model back to blender, I began tweaking the mesh to find out the issue, I did some research and found out that the issue was the "normals" were inside out. It's like wearing a clothe inside out, I am only seeing the underside of the mesh, which is why it turned black when I applied the material.

st_6a.jpg

THE SOLUTION

Now the solution wasn't as straightforward as just flipping the normal points from blender, The issue was that I didn't know the direction at which the normal was flipped in the first place, when working with a 3d model, it could have been flipped in 3 x 3 different directions (upwards + leftside, downwards + rightside, etc)

st_6.jpg

I had to toggle the mesh in every option and import it severally times into unity to see the results, I used the slow process of elimination to turn it the right way.

st_6c.jpg

During this process of elimination, I stumbled upon a very funny scenario, If you look closely at both feet you would see that one of those shoes is lit while the other isn't.

That is because even though the mesh is facing the light source, mathematically, the normal points are inverted, meaning, behind the shoe is lit, while the front of the shoe is now flipped to the shadow direction.

st_6e.jpg

I solved this by simply rotating the normal points from within blender -90 degrees on the x-axis.

TESTING OUT THE ANIMATION

Now it's time for the fun part of animation, I created an animator component on my 3d character and imported the (.fbx) animations from mixamo and scripted each animation to the keyboard strokes.

st_5.jpg

Jump Animation
jump_anim.gif

Slide Animation

Now, this slide animation still needs a bit of finesse cause I still need a write a camera follow a script so it doesn't look like he's running away from the view.
slide_anim.gif

Run Animation
run_animation.gif

Now if you take a look at the shoe sole I did some material design under the sole but I'm still thinking of changing the pattern, I don't really fancy the shoe pattern TBH.

WHAT NEXT

I guess the next step now is to start some scripting, I need to get the camera moving and following the character, I also need to script some vector motions on the character, then I need to script some lane movements. There are gonna be three lanes in this game.

Join me next time when I tackle this... thanks for your time :-)

Check out my previous episode here:

SKY BOX SETTINGS AND SOME ADDITIONAL 3D LOW-POLY ASSETS

hive_banner_2.gif



0
0
0.000
1 comments