- Home /
Is it possible to set individual EdgeCollider2D points, without replacing the entire array?
Creating a Vector2 array and then assigning it works, as follows:
collider.points = newVector2Array;
However changing just one of those points doesn't seem to work, for example:
collider.points[0] = new Vector2(5, 10);
The code compiles fine and runs, but the edge collider points array remains unchanged.
Is there any way to do this, or do you have to replace the entire array each time?
Thanks
Answer by Discipol · Jul 31, 2016 at 04:42 AM
collider.points = collider.points should retrigger internal update while keeping the new array unmodified
Your answer
Follow this Question
Related Questions
2D Raycasts Only Work in Certain Directions 0 Answers
Get mapping postion of 1 point on a plane defined by 3 points 1 Answer
Adjusting an angle of a collider2D to a linerenderer that is user-created 0 Answers
How can I find intersection points between a circle and Colliders 2D ? 0 Answers
Making a collider the size of the object it is attached to. 2 Answers