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 - BlueLemming

Pages: [1]
1
I've tried snapping but that affects the speeds of my character, which are all float values. So my walking speed of "1.25" is essentially snapped down to "1".

The asset I referred to basically just handles the drawing of the sprite rather than snapping the transform. It keeps the "real" position (transform), but snaps the drawing of the sprite. That way my speeds and position aren't affected but the sprite isn't teared from a half pixel or whatever. I was hoping 2DTK had a native way of handling that.

2
I'm having an issue with "pixel tearing" in my game. I'm using 2 test keys to move my character 0.01 pixels forward/backward and I can see my sprite tearing as it goes through decimal coordinates. I've tried running sprite.MakePixelPerfect() during Update, LateUpdate and directly after the functions that move the character 0.01 pixel at a time, yet I see no difference. So I'm not exactly sure what MakePixelPerfect() or how I am supposed to use it.

If MakePixelPerfect() isn't the answer, how would I solve this pixel tearing issue? I bought this asset hoping it would work but it seems it's incompatible with TK2D, but that's the effect that I'm aiming for.

3
Support / Use BoxCollider2D on TileMaps instead of EdgeCollider2D
« on: April 15, 2015, 05:03:48 am »
I'm fairly new to Unity and 2D Toolkit, so bear with me, but I'm having some huge issues with the EdgeCollider2D that the TileMap automatically generates for my 2D platformer.

I'm trying to code my "own" collision system using Raycasts because I don't want to use any Box2D Physics and Physics2D.OverlapCircle/OverlapPoint doesn't work on EdgeColliders. I'm trying to stop my player from falling when he hits the ground. So my Raycast detects I've collided with the EdgeCollider 1 pixel below me, sweet! but if I'm falling fast enough that it doesn't catch that edge of the edgecollider, then I'll fall inside the tile and it will never register the collision.

So I thought why not just use BoxCollider2D for my 32x32 tiles? It would make collisions so much easier but I can not for the life of me figure out how to tell TK2D to generate boxes instead of edges. I've tried changing the colliders in my SpriteCollection to every different kind, and it still makes edge colliders. I found a script that can generate it for me here (https://github.com/kevdotbadger/BoxColliderGenerator) but unfortunately it doesn't seem to work with Unity 5.

I'm in a bit of a rut, I'm hoping I can find some help here. If I'm unable to use box colliders, how do you guys suggest I go about coding a simple collision system without Box2D physics?

Pages: [1]