Destroyable tile blocks with TilesExtra

still issues with collider
This commit is contained in:
2023-06-28 19:58:30 +03:00
parent c79d2a6b49
commit 2dfece0eb0
9 changed files with 1745 additions and 47 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ public class Character : MonoBehaviour
_isOnBridge = mapElement == MapElementType.Bridge && !_isFalling;
float v_movement=0;
if (mapElement==MapElementType.Wall || _isOnLadder || _isOnBridge)
if (mapElement==MapElementType.Wall || _isOnLadder || _isOnBridge|| mapElement == MapElementType.BreakableWall)
{
var leftCheck = GetMapElement(Vector2.left);
var rightCheck = GetMapElement(Vector2.right);
@@ -93,7 +93,7 @@ public class Character : MonoBehaviour
private MapElementType GetMapElement(Vector2 direction)
{
var raycastHit=Physics2D.BoxCast(_boxCollider.bounds.center, _boxCollider.bounds.size, 0f, direction, .1f, _mapLayer);
var raycastHit=Physics2D.BoxCast(_boxCollider.bounds.center, _boxCollider.bounds.size, 0f, direction, 0.1f, _mapLayer);
if (raycastHit)
{