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

Pages: [1]
1
Support / Problem with OnTriggerEnter and Tilemap
« on: April 03, 2013, 07:22:04 pm »
Hi,

sorry, maybe it's a basic question but I'm not really a coder so I can't understand how to do :

I'm working with a tilemap and I want some bullets shot by the player to trigger when they entering any tilemap collision. I put a trigger on my bullets and the triggering works well (I check it with other colliders) but my problem is that I don't know how to "define" the tilemap. I found that the bullet triggers the collision with a chunk of the tilemap, but it seems very complicate to make a loop to check every chunks.

Here my code in the bullet script :
Code: [Select]
void OnTriggerEnter(Collider enteringCollider)
    {
        if (/*enteringCollider is a tilemap collider <-- this is here I don't know how to do*/)
        {
            Debug.Log("bullet touch map");
            isDead = true;
        }

Sorry for my english too, I'm french, and thanks for your answers.

Pages: [1]