Question by
unity_p2iE2Kryoddzqw · Mar 18, 2018 at 06:33 PM ·
2dcollider2dlinerenderer
line rendere not aligned with collider
i'm raycasting, then drawing the line with line render 2d and adding edge collider 2d. but these lines are differently placed. what causes this?
untitled.png
(13.2 kB)
Comment
Best Answer
Answer by unity_p2iE2Kryoddzqw · Mar 18, 2018 at 07:27 PM
found the problem.
the points in the collider are in local space, while my linerenderer was configured to use world space.
while i want to use worldspace in both, i called transform.InverseTransformPoint to initialize the collider