Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - andreasgan

Pages: [1]
1
Support / Re: PolyNav with TileMap
« on: January 28, 2015, 05:33:49 pm »
Hello again,
I finally got this working fine, but when I started building a tilemap that is bigger than 1 chunk, I encountered this weird problem:

http://i.gyazo.com/f09e0f08e19ce3117bdc5f3233eb517d.png

I seriously can't figure this one out. Except the fact the colliders are all messed up, I have no idea what's wrong, or what's going on.

If you would be so kind as to help me with this, here's the code:
http://pastie.org/9868742
Thank you!

2
Haha thanks! That's so ridiculously obvious, I dont know why i didnt think of that myself!
Thank you :)

3
I've converted the TileMapColliderBuilder2D to build polygoncollider2ds instead of edgecollider2ds, but now each collider now has an extra point. I understand that this was required for edge (to create the last "wall" and close the collider), but now that I have poly, they automatically create the last wall.

Does anyone know how I can fix this right off the bat?

I don't understand all of the TileMapColliderBuilder2D code, especially not the part with making "verts" and "indices," so any hints as to where to look / what to google so that I can figure it out myself works too.

I attached some example screenshots below.

4
Support / Re: PolyNav with TileMap
« on: January 19, 2015, 11:09:37 am »
Thanks, I already found that, but last time I checked his code made box colliders, and it wasn't very effective. No problem though, I already made polygon colliders; I just replaced EdgeCollider2D with PolygonCollider2D in all the files :)

There's some things I have to tweak to make it perfect though; tk2d creates an extra collider point for each path, and the polygon is inverted (points in wrong direction. But this isn't really a problem, polynav has a "invert polygon" feature)
I also have to add the polynav obstacle script to all chunks.
And lastly make sure all this works when I edit tiles and build.

I haven't had time to start diving into the code and fixing this yet, so if you got any tips I'd appreciate it :)

5
Support / PolyNav with TileMap
« on: January 17, 2015, 02:53:28 pm »
Hey, I'm wondering how I can use polynav with 2d toolkit's TileMap

Polynav is a simple 2D pathfinding solution that uses polygon colliders/box colliders on obstacles.
http://forum.unity3d.com/threads/poly-nav-pathfinding-for-unity2d.224962/

I'm wondering how I can make my tiles obstacles with polynav.
Each "obstacle" object needs to have a BoxCollider2D or PolygonCollider2D, and a "PolyNavObstacle" script.

My tiles are all squared, and they are going to be changed/deleted ingame.
I was thinking I need to find the edges of all "islands" so to speak, and make seperate polygoncollider2ds from them.
Note: Using prefab tiles would create too many gameobjects.

How can I achieve this? It's been bugging me for a while and I can't figure it out.
I'm sorry if this was messy and hard to understand. I've never been good at explaining things :/
Any thoughts at all would be appreciated.
Thank you :)

EDIT: I'll be trying to modify the 2d toolkit code to use polygon colliders instead of edgecolliders. Not sure how yet, but I'll try.

Pages: [1]