I have two points(Spheres) with a line(capsule) and another point with a line.
I called them PointA, PointB, PointC, Line and Line 2.
Line goes through PointA and PointB and PointB and the first Line are rotating around PointA.
Now I want Line2 to rotate with PointB around PointA… but I also want Line2 to never leave the not moving PointC.
Do you guys have any ideas ?
If something isn’t clear I’ll try to do my best to explain it to you
Anyway, when posting, use the “upload a file” button, select your picture, and once it uploads, click either “thumbnail” or “full image” on the upload thing at the bottom of your posting box, and it should appear where your text cursor is in the text area.
I realized something: try using transform.RotateAround(point, angle) with the moving points, and transform.LookAt(point) to have the point’s line still point at point C. this should work with both lines.
Where is line2 cast from? I know Line1 is cast in point A.
And what do you mean by “look at it with the Y-axis too?” If you mean facing the Y axis towards Point C, I am having the same problem too, but in my case, it’s so my characters face feet-first towards a distant planet…
basically, have your sphere point like this (Note that I ripped this straight out of my code, so it’s in JS):
gravityVector = <the point you want to point to> - enemy.transform.position;
<object to point with>.transform.up = -gravityVector;
If the object ends up pointing away from it instead though, remove the negative operator on the second line. (I had to leave it in, as my characters heads were pointing towards the origin! )