Game Development Reference
In-Depth Information
In the final section, you revisited Mecanim and learned how to create a mask that would allow part
of the character's body to animate independently of the rest. Creating a new layer in the Gnome
Controller, you were finally able to make use of the hat animation that exposed a secret laser gun.
To implement the laser, you were introduced to the Line Renderer component. Through scripting,
you were able to control its length with Physics.Raycast. In that code, you were able to check for
intersections with colliders and position both a small point light and the sparks prefab at the hit
points. To make the laser more interesting, you created a useful little script that helped you gain
access to shader parameters in order to animate the textures UVs or mapping offset. Finally, you
discovered the Ignore Raycast layer that allowed you to selectively ignore the raycast intersection
with certain colliders without adding a single bit of code.
Search WWH ::




Custom Search