Some questions about tile sources, collisions and cameras (MOSTLY SOLVED)

hey so this may sound very stupid and im sorry if its something simple im missing but i have a tilemap and i am trying to make some collisions. so im on the documentation for it https://www.defold.com/manuals/tilemap/
and im looking at the collisions section. i have followed its intructions but i am not able to specify the tiles i want to be colliders like it says i can. it says to just select the collider group and click on the tiles i want and they should turn a color showing that they are part of that group, but they arent changing color. im not sure if im not equiping a tool to do it or something please help. many thanks. ask me questions if you need.

Update: the whole of the tile source isnt really working i cant animate tiles when i try to do it they dont light up to tell me which one im animating or anything. so i think this is a program issue/ bug

Did you also add the same .png in the Collision field? Like this:

Once you have that done you should be able to select a Collision Group in the Outline and paint the tiles of the tilesource that you want to assign to the group.

ah yes now i can thanks so much you have no idea how much this was bugging me i feel pretty stupid now. But that aside the animations still arent working. any ideas on that?

Hmm, what happens when you select the animation in the outline and press Space? Don’t you get a preview in the lower left corner of the scene view?

oh yeah sorry that works thanks very much i couldnt figure it out because the tutorials i followed before did it differently cause they were using an old version of defold. actually i cant really find much on collisions or animated tiles. if i may id just like to ask firstly why arent the tiles i animated working in the build? and how do i actually setup working collisions. you dont have to answer if you dont want to but it would be much appreciated. even if you shed some light of it i would be grateful. many thanks.

Tilesource collision shapes manual: https://www.defold.com/manuals/tilemap/#_tile_source_collision_shapes

Here’s the Tilemap section of the Physics manual: https://www.defold.com/manuals/physics/#_tilesource_collision_shapes

Here’s a small sample project that uses tilemap collisions: https://github.com/britzl/publicexamples/tree/master/examples/tilemap_collisions

Tilesource animations work only when used as the input source to a sprite, particle effect or similar. Tilsource animations do not work when used in tilemaps.

hey im sorry this is random but im getting a problem with using cameras. when i use a camera it doesnt display a sprite in the game object with the camera anymore. and if i change the z of the game object the screen goes black. any ideas?

Are you using the built in camera component or one from the asset portal?

To use the camera I am just making a new camera component in a game object from the collection editor and then just calling the code to focus to the camera from inside a script in the same game object

actually the camera problems aside whats more annoying to me is that i was trying to make a lighting effect like the one you have on one of your examples for 2d lighting. and somewhere it said to start with the render tutorial on grading. and i have tried following the tutorial to the letter twice but all i get is a black screen when loading the game.

You need to pay attention to the near and far values you set on the camera component. The values define the range of z-values that will be drawn. My guess is either that the sprite component ends up outside the near and far range or that the camera is positioned in such a way that the sprite is outside of the area covered by the camera.

Bump. I figured this would be a relevant thread for this.

Tilesource animations work only when used as the input source to a sprite, particle effect or similar. Tilsource animations do not work when used in tilemaps.

Is this still true? I too was wondering why my tiles weren’t animating in build. Is there really no way to simply animate a tile on a tilemap?

1 Like

I believe this is still true, unfortunately. It’s pretty simple to set up your own animations with tilemap.set_tile, though. Not as convenient as the builtin go.animate/gui.animate, but not too bad.

1 Like

Correct, it’s currently not possible.