478798 (1) [Avatar] Offline
#1
Hello!

I enjoyed the beta chapter of this book but it did bother me that the sprite doesn't 'Idle' in the last direction travelled. So just a small suggestion really, to alter the code to ensure the sprite, when finished moving, is 'Idle' in the same direction.

if (Mathf.Abs(deltaX) != 0)
{ // change direction
  transform.localScale = new Vector3(Mathf.Sign(deltaX) / platformScale.x, 1 / platformScale.y, 1);
}


Just an ickle bit of polish, perhaps left as an exercise for the reader.

Thanks again,
Jason
jhocking (176) [Avatar] Offline
#2
Thanks, cool suggestion! I'll check it out.

(by the way, it's unnecessary to get the absolute value for that check; positive or negative, either way is not zero)