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 - 2x4b

Pages: [1]
1
Support / Re: Triggering events when player collides with certain tiles
« on: December 04, 2014, 02:36:02 pm »
Thanks so much for this answer. I'm one step closer to getting this all understood :)

I'm really stuck however on accessing the tilemap from script. Could you please let me know where I'm going wrong?

Code: [Select]
public tk2dTileMap tileMap; // I use unity's inspector to add the tilemap into here


// Update is called once per frame
void Update () {

Vector3 testLoction = new Vector3(0f,0f,0f);
int tileId = tk2dTileMap.GetTileIdAtPosition(testLoction,0);

}

I get this error:

Code: [Select]
An object reference is required to access non-static member `tk2dTileMap.GetTileIdAtPosition(UnityEngine.Vector3, int)'
Thanks so much.

2
Support / Triggering events when player collides with certain tiles
« on: November 25, 2014, 12:22:30 pm »
Hi All,

I'm just wondering how I can say, for example, that certain tiles are "ground" so I can set a boolean in the player to "grounded" when the player is colliding with at least one "ground" tile. Would each ground tile need to be a prefab to do that?

Thanks a lot :)

Pages: [1]