- Home /
hard to get a position
There is a stick. I want to move this stick as long as the length of the stick with the same angle. Can anyone help me how to do this? It looks simple but not to me ㅜㅜ
For example, the stick's two positions are (0, 0, 0) and (1, 1, 0). I want to put the stick at (1, 1, 0) and (2, 2, 0). same angle and same distance (the length of the stick). Actually I want to rotate the stick by 180 degree. Sorry for my bad english.
Hard to get the actual question.
Can you elaborate with maybe an image or something? You can even provide the code you have tried.
When you say you want to “move” the stick, do you mean you want to animate it?
$$anonymous$$adeck: No. I just need to rotate the stick. But the anchor point of the stick is currently at (0, 0, 0). Not in the center. That's why I am confused.
Answer by bubzy · Dec 04, 2014 at 02:57 PM
if you rotate the stick it is no longer at the same angle....
the answer to your question is probably :
Vector3 stickSize = new Vector3(1f,1f,0f);
transform.position += stickSize;
Thank you for your comment. But the stick's position is variable. That is just an example. So I can't get the fixed coordinates. And the anchor point of the stick is an end of the stick. Not in the center. In this case, I wonder how to rotate the stick on the center by 180 degrees.
what?
"And the anchor point of the stick is an end of the stick. Not in the center"
"In this case, I wonder how to rotate the stick on the center by 180 degrees."
you really need to provide a picture as you aren't making sense :(
anyway, if you do want to rotate a stick by different points, you are going to have to either make a model with an offset centre, or you are going to have to make a parent object that the sticks position changes in relation to, and rotate it in a relevant manner
I understand what you explained. I guess I can try your 2nd suggestion. Thanks for your comment.
Your answer
Follow this Question
Related Questions
translate 2 Answers
Random Range Position 2 Answers
Changing a GameObjects Position 1 Answer
How to make cubes between 2 point and stick them together? 0 Answers
Two Firing points, Vectors 1 Answer