- Home /
Rotating ray origin.
Hi. i'm trying to find a way to make the raycast2d origin rotate with GameObject.
Code? We need to know how you are doing so that we can correct.
Answer by hexagonius · Nov 26, 2014 at 05:03 PM
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.
Even don't know what option is more convenient for me. it's so hard to choose. Thank for help
P.S. I cant put thumbs up coz im new here
Answer by Baste · Nov 26, 2014 at 05:01 PM
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.