- Home /
Question by
ForgottenCheese · Dec 01, 2013 at 09:27 AM ·
2dcollidermovelinerendererbox
How to move BoxCollider2D so it covers a line renderer?
The lines only have two points and I can access both of them. I played around with BoxCollider2D.center and BoxCollider2D.size, but not sure how to make it work.
Comment
parent a gameobject to your boxcollider2d so its pivot point be on first point of your line renderer .then try to scale parent of boxCollider2D up to the distance of two points on your line renderer . hope it helps.
Thanks it works after I got the center of the two vectors, but now I'm stuck on rotating it properly.