Author Topic: Attaching BOX Collider at Runtime  (Read 2531 times)

skyRider

  • Guest
Attaching BOX Collider at Runtime
« on: July 20, 2012, 01:21:40 AM »
Hi All ,

In my scenario i am adding Sprites at Runtime. As i want to take touch on these sprite so the solution is to attach a box collider, How can i attach a box collider to a sprite at runtime as sprite is also creating at runtime.

Help would be appreciated.
Thanks

PhilipC

  • Guest
Re: Attaching BOX Collider at Runtime
« Reply #1 on: July 20, 2012, 09:45:48 AM »
Should be able to just AddComponent<BoxCollider>(); might need to resize it though