Hello Guest

Author Topic: 2D line  (Read 3862 times)

finaldev

  • Newbie
  • *
  • Posts: 1
    • View Profile
2D line
« on: November 17, 2012, 10:34:16 pm »
Hey guys,

If someone could point me in the right direction for the following it would be greatly appreciated!

I was wondering if it was possible to create a 2D line at run time?
Is it also possible to create the line with a polygon collider and manage the collider's points at run time?


Thanks in advance,

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D line
« Reply #1 on: November 18, 2012, 12:46:11 am »
1. Create a 2D line - there's a sample here:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,293.0.html

2. Polygon collider points at runtime - no. It is really really slow to create polygon colliders. You can't modify them once created, so changing the collider will involve recreating it. Not a good way to do this. I suggest using box colliders to approximate shape - the cost for moving them is a lot lot lower.