Game Development Reference
In-Depth Information
X : Tiling: 0.5 , Offset: 0
Y : Tiling: 1 , Offset: 0
Base Alpha cutoff : Drag the dragger to the very right end
We have now got the material for our Player .
7. Next, we go back to the Player and assign this material to him by dragging
and dropping M_Character from the Project view to the Player object in the
Hierarchy view. Finally, add the Box Collider and add a RigidBody to the Player .
We will use the Box Collider because our Player is basically a plane and doesn't
need any complex collider to detect his collision.
8. Let's click on the Player and go to Component | Physics | Box Collider set Size: x:
0.4 , y: 0.875 , z: 1 and Center: x: 0 , y: -0.06275 , z: 0 .
9. Then, we will add the RigidBody , which is used to calculate our walking speed,
jumping, and collision detecion with the level; go to Component | Physics |
RigidBody and make sure that Use Gravity is On and the Kinematic opion is Off .
10. Set the freeze the rotaion of the object ( Freeze Rotation ) by clicking on the arrow
in front of Constraints . In Freeze Rotation , check each box X , Y , and Z to freeze
rotaion. We will also check the Z box to freeze the character movement in the
Z-axis, as shown in the following screenshot:
Objective Complete - Mini Debriefing
We just created a plane that will act as our main character, our Player . We also created
a material for our Player by using Transparent | Cutout | Soft Edge Unlit Shader . This
Shader will cut out the Alpha channel and make it transparent. In addiion, it will also soten
the edge, not to the shape of the object it is on, but instead it will soften the edges of the
image itself. We can control which porion of the image will be cut out, and how much the
edge will soten by adjusing the Base Alpha Cutoff slider.
 
Search WWH ::




Custom Search