1
Support / Re: how to setup colliders programatically
« on: August 07, 2013, 10:38:23 pm »
I was using mesh collider because i'm new to unity so im still a little bit lost. Your example works perfectly, thanks a lot.
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.
tk2dSpriteCollectionSize sz2 = tk2dSpriteCollectionSize.Default();
_sprite = tk2dSprite.CreateFromTexture(texture, sz2, new Rect(0,0,texture.width, texture.height), new Vector2(0,0));
GameObject go = new GameObject();
MeshCollider collider = go.AddComponent<MeshCollider>();
collider.bounds = new Bounds(new Vector3(0,0,0), new Vector3(10,10,1));
_sprite.collider = collider;