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

Pages: [1]
1
Support / Re: How to get the current clicked tile on a tile map?
« on: August 24, 2013, 07:50:48 am »
Thanks. This will work. Just one more question. :) Is it possible to get all the tiles for a given layer? I've checked the class tk2dTileMap but it has no methods which will return such results. There is a property TilePrefabsList which is not documented yet, in my case it contains no items, and probably will give only the prefabs and not the actual tiles.

2
Support / Re: How to get the current clicked tile on a tile map?
« on: August 22, 2013, 09:59:24 pm »
Is there a solution without enabling caps on the sprite collection? Could you give me some guidelines what script will be needed?
I've tried with front and back polygon collider set, but it seems it is not working. This is the script which I have but it is not working:
Code: [Select]
if (Input.GetButtonDown("Fire1"))
        {
            Ray ray = gameCam.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit = new RaycastHit();

            if (Physics.Raycast(ray, out hit))
            {
                Debug.Log("test");
            }
        }

3
Support / How to get the current clicked tile on a tile map?
« on: August 22, 2013, 09:51:26 pm »
Hi. Is there an API which I can use to get the current clicked tile on the tile map? I have a character which is placed on top of a tile map and I want to be able click somewhere on the map and move the player towards the clicked point. Also I want to know exactly which tile is clicked.


Pages: [1]