Rotating ray origin.

Hi. i’m trying to find a way to make the raycast2d origin rotate with GameObject.

[35873-sinkpicturescar±+коsasпия±+копия+(2).jpg|35873]

Create two empty gameObjects, and call them Origin1Marker and Origin2Marker. Make them the children of the gameobject you’re rotating, and put them where you need the raycast origins to be.

Now, when you raycast, just select the position of the markers as the origin of your raycast.

Depends on what the origins are. the easiest way would be to child 2 empty gameobjects to your triangle and use their position (not localposition) as starting points.
If they’re already some Vector3 with small numbers denoting the offset to the triangles origin do a transformpoint on the triangles transform.