First, sorry for my "questions spam". I've got A LOT of questions cos I'm newbie with unity and 2dtoolkit. Most of them I find easily in the forums, but some of them don't.
Well, ok. I got a Collection with 2 sprites in it. It's two 'pointy rocks'. The first one is bigger and the second is smaller. Since they're so pointy, I can't use box colliders. Then I used Polygon colliders.
I've created a tk2dSprite and selected the newly created Collection and selected one of the sprites.
Now, to Instantiate it randomly, I've created a Prefab with this Sprite, and linked the Prefab in a script.
This script is now responsible for instantiating the Prefab in the scene. So, I use the following code:
(I created more variables to make the code easy to follow)
GameObject go = (GameObject)Instantiate(rocksPrefab);
tk2dSprite sprite = go.GetComponent<tk2dSprite>();
int numSprites = sprite.Collection.spriteDefinitions.Length;
sprite.SetSprite(sprite.Collection.spriteDefinitions[Random.Range(0, numSprites)].name);
This is enough to instantiate the tk2dSprite with the RocksCollection in it. But when I do the SetSprite part, it changes randomly to one of the sprites nicely, BUT do not UPDATE the collider. I keep getting the collider which the prefab is set. Why is that? And how can I fix this?
Thanks again.