Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnCollisionStay2D(Collision2D target)
- {
- if (target.gameObject.tag != "ground")
- {
- isWalkable = false;
- //<condition> ? value to use if true : value to use if false
- monster.rigidbody2D.transform.localScale = new Vector3((transform.localScale.x == 1) ? -1 : 1, 1, 1);
- Debug.Log ("Tile is not walkable");
- }
- else
- {
- isWalkable = true;
- Debug.Log("Tile walkable");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement