Skip to content
Snippets Groups Projects
Commit 8056b083 authored by Robin Halseth Sandvik's avatar Robin Halseth Sandvik
Browse files

Character now tracks last direction it moved.

parent 0c469099
No related branches found
No related tags found
1 merge request!53ToolTips, new ability parameter system & misc clean ups.
......@@ -79,6 +79,9 @@ namespace BigSock {
protected Rigidbody2D rb;
// The direction the character last moved.
protected Vector2 moveDir;
/*
The inventory of the character.
......@@ -166,6 +169,7 @@ namespace BigSock {
Try to move in a given direction.
*/
protected virtual bool TryMove(Vector2 direction) {
moveDir = direction;
if(direction != Vector2.zero) {
rb.AddForce(direction * (float) MovementSpeed * Time.fixedDeltaTime, ForceMode2D.Impulse);
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment