Skip to content

Commit

Permalink
Merge pull request #19 from acord-robotics/master
Browse files Browse the repository at this point in the history
Fix solid objects collider issue
  • Loading branch information
Gizmotronn authored Dec 29, 2020
2 parents bd2649e + 988f47d commit 349890f
Show file tree
Hide file tree
Showing 32 changed files with 115 additions and 69 deletions.
5 changes: 4 additions & 1 deletion Pokemon RPG/Assets/Scenes/New Scene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -6525,6 +6525,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
moveSpeed: 5
solidObjectsLayer:
serializedVersion: 2
m_Bits: 256
--- !u!212 &741721365
SpriteRenderer:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -6583,7 +6586,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 741721363}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3, y: 3.5, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
Expand Down
2 changes: 1 addition & 1 deletion Pokemon RPG/Assets/Scripts/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ IEnumerator Move(Vector3 targetPos) { // Do something over a period of time (IEn
}

private bool IsWalkable(Vector3 targetPos) { // Check if the tile position is walkable
if (Physics2D.OverlapCircle(targetPos, 0.3f, SolidObjects, solidObjectsLayer) != null) // Tile is not walkable if the IF statement is not null, as there is something at that Vector3 position // Solid objects layer as third parameter
if (Physics2D.OverlapCircle(targetPos, 0.3f, solidObjectsLayer) != null) // Tile is not walkable if the IF statement is not null, as there is something at that Vector3 position // Solid objects layer as third parameter
{
return false;
}
Expand Down
8 changes: 8 additions & 0 deletions Pokemon RPG/Assets/Tiles/tilesets.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 349890f

Please sign in to comment.