Week 10 – Movement Code UmLet

This is the UmLet taht acontains the variables and the expected result for the Movement.cs code.

Movement1.cs

_spd is a public variable which is used to retain the speed that is used in movement

_ch is a private variable which gets the same value as _spd; it will give _spd the specific value after it has been modified when running or walking/sneaking

_hz, _vt, _dt are variables used to retain the values of the movement on the 3 axes, for walking forward, backward, inside, out and for possible jumping

_snk and _rn are booleans which check if the player is pressing the sneak/walk or running button, to allow the modification of the speed variable

rb makes a connection to the rigidbody, to be used when I would implement the jump mechanic, through adding a force on the Y axis, at the suggestion of my tutor.

_rFacing and _lFacing are Quaternions which would help in rotating the side the player is facing

_sw is the variable which is used in the switch when changing sides, depending on the case, left or right

While the script does work it is somewhat buggy, as it would not keep the direction of the player, the speed would not return to the original value. I am looking into fixing these bugs.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s