Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by mhhk88 · Dec 04, 2014 at 09:30 AM · positionvector

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.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HarshadK · Dec 04, 2014 at 09:36 AM 1
Share

Hard to get the actual question.

Can you elaborate with maybe an image or something? You can even provide the code you have tried.

avatar image Madeck · Dec 04, 2014 at 04:26 PM 0
Share

When you say you want to “move” the stick, do you mean you want to animate it?

avatar image mhhk88 · Dec 05, 2014 at 04:44 AM 0
Share

$$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.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

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;
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mhhk88 · Dec 05, 2014 at 04:56 AM 0
Share

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.

avatar image bubzy · Dec 05, 2014 at 07:06 AM 0
Share

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

avatar image mhhk88 · Dec 05, 2014 at 08:31 AM 0
Share

I understand what you explained. I guess I can try your 2nd suggestion. Thanks for your comment.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges