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.


Topics - ccampama

Pages: [1]
1
Support / Tilemap: collider seems wrong if flip used on tile
« on: November 27, 2013, 06:10:39 pm »
Hello again,

I'm using latest Unity with latest TK2D as of today. I have a tilemap consisting of 64x64 tiles. Then there is a ball colliding inside it. Everything has been fine until I found that if I have a slope of tiles (I rotate the gravity vector and the camera to "rotate the scenery" and make the ball roll) with some of them flipped and some of them not, the sphere collider of the ball seems to find hidden edges between the tiles, and it kind of jumps and collides strangely. The tiles all have a trimmed box as collider, and if the slope of tiles shares the same "rotation" (flip) among all the tiles composing it, then the collision is smooth and the ball rolls fine as it should. But if some of the tiles are flipped in one direction and others in a different one, then the ball collides wrong when passing over the union between two differently flipped tiles.

I'm not sure if I have been able to explain it in a clear way ?

Thank you very much in advance!

2
Support / TileMap: weirdness when using it as a Prefab
« on: October 14, 2013, 08:41:46 pm »
Hi,

I have a TileMap already designed. Then I want to replicate it for 10 scenes and would like that any modification in it on any given scene would be automatically generated in any other scene. So I created a prefab of this TileMap. Then, when I open other scenes, I try to drag the prefab from the Project window to the Hierarchy, but to my surprise:
- Whenever I cross any of the views in Unity while dragging the prefab, I can see that in the hierarchy is appearing a TileMap Render Data. So if I move the mouse around the screen on and on while dragging, I get tons of Render Data objects.
- I also end up getting this exception while in the editor:
"
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[tk2dRuntime.TileMap.Layer,System.Boolean].get_Item (tk2dRuntime.TileMap.Layer key) (at /Applications/buildAgent/work/c514da0c8183631c/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
tk2dRuntime.TileMap.BuilderUtil.CreateRenderData (.tk2dTileMap tileMap, Boolean editMode, System.Collections.Generic.Dictionary`2 layersActive) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapBuilderUtil.cs:317)
tk2dTileMap.Build (BuildFlags buildFlags) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:276)
tk2dTileMap.EndEditMode () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:486)
tk2dTileMap.Awake () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:121)
"
 Couldn't tell exactly when.
- If I delete all the Render Data instances and leave only the one that seems to be working, if I make a modification to the TileMap (adding some random tiles), it seems to ignore it in runtime (but I can see the new tiles in the editor!). And if I switch to another scene (commiting the TileMap and Applying the changes to the Prefab just before), the changes to the TileMap are ignored even in the editor.

 Is all this erratic behaviour because I am doing something wrong trying to create a Prefab of aTileMap? Should I do it in another way?

 I see that other option is to Additively load a scene that has this TileMap. Is it a much better solution?

 Thank you very much in advance!



3
Support / Tilemap: exceptions thrown if no colliders in tilemap
« on: October 13, 2013, 07:55:42 pm »
Hi!

We have just created a second tilemap in our scene with the idea to simulate a parallax scroll as the background of the main tilemap. This background tilemap is currently using only one tile (repeated many times) that has "force none" as the collider. But when we run the project, we get two exceptions like this one:
"
NullReferenceException: Object reference not set to an instance of an object
tk2dRuntime.TileMap.ColliderBuilder.Build (.tk2dTileMap tileMap, Boolean forceBuild) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapColliderBuilder.cs:38)
tk2dTileMap.Build (BuildFlags buildFlags) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:282)
tk2dTileMap.EndEditMode () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:486)
tk2dTileMap.Awake () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:121)
"
 Are we doing something wrong, or is it a little bug? When we set a collider for the tile, then everything is fine, but we don't want it to have any collider.

 Thank you in advance!

4
Support / Tilemap: collision tile id problem
« on: October 07, 2013, 01:15:35 pm »
Hi again,

we have faced another problem using tilemaps: almost all of our tiles in a tilemap have a string with a kind of "type" label on it, in the Data section. But when we let a gravity-driven sprite collide with the tilemap, we find that on some of the tiles (always the same ones), the collision works fine but "GetTileIdAtPosition" returns "-1" (as if no tile was there?), so we can't get the TileInfo for this collision. Where could we start to look on the problem? Any hint on what could we be doing wrong?
 Some of the tiles in the tilemap have prefabs associated with them, and these ones always work ok. The problem happens with some of the tiles that have a string set but not any prefab (the funny thing is that SOME of the tiles with no prefabs but with string seem to work fine!).
 Please note we are sharing the project via SVN (could it be any indexing conflict or something like that?). Should we do any reindexing or something? (we tried the one in the "2D Toolkit" menu in Unity menu bar, but with no success)

 The collision code is like:
Code: [Select]
int tileId = tileMap.GetTileIdAtPosition(collision.transform.position, 0);
if (tileId >= 0)
{
      tk2dRuntime.TileMap.TileInfo tileInfo = tileMap.GetTileInfoForTileId(tileId)
      string str = tileInfo.stringVal;
}

 Thank you in advance for any help or hint you might provide.

5
Support / Tilemap: flip tile with associated prefab problem
« on: October 07, 2013, 01:00:55 pm »
Hello all!

We are working with 2D Toolkit to create a Tilemap and making a gravity-driven sprite to collide with it. Everything has been fine until we have found a problem: if we place a tile that has a prefab associated to it, when we use the flip tool in the Paint menu, the tile is shown fine in the editor, but it reverts to its original rotation when we hit "Play", as if it didn't have any flip flag on it. Are we doing something wrong?

Thank you in advance!

Pages: [1]