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 $$anonymous$$ · Sep 30, 2013 at 11:44 PM · rotationpolygonplacementcylinder

I need a 3d polygon between two cylinders

I asked a similar question earlier. But I guess it wasn't specific enough. I need to place two cylinders down as a first person controller. After that I need to select the two cylinders and place a polygon between the two. That is basically what I need. If you have any questions ask. Thank you.

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 robertbu · Sep 30, 2013 at 11:55 PM 0
Share

You have multiple technical issues here, and I don't know which one(s) you are seeking help for: 1) cylinder placement, 2) cylinder selection, and 3) placing objects between cylinders. If you are seeking answers to more than one of these, I suggest you break your question into separate questions and do some additional research. Also you need more details. Does the object between the cylinders need to be rotated to match the line between the two cylinders? Does the object need to be scaled to match the distance between the two cylinders? Does the object just appear between the two cylinders or is there some other mechanism? Etc.

avatar image $$anonymous$$ · Oct 01, 2013 at 12:20 AM 0
Share

Just placing a cube in between the two cylinders with the same Y scale height as the cylinders (1).

The cube does need to be rotated so it can be placed diagonally across the ground.

I have made the code for the placement of cylinders. The reason why I added it to the question is so that an answer doesn't completely miss the target of the question. Its obviously not going to be tailor made, I just thought it would be good to add the implementation of the code so I don't have to completely rewrite the code.

Thanks.

avatar image $$anonymous$$ · Oct 01, 2013 at 12:21 AM 0
Share

Just placing a cube in between the two cylinders with the same Y scale height as the cylinders (1).

The cube does need to be rotated so it can be placed diagonally across the ground.

I have made the code for the placement of cylinders. The reason why I added it to the question is so that an answer doesn't completely miss the target of the question. Its obviously not going to be tailor made, I just thought it would be good to add the implementation of the code so I don't have to completely rewrite the code.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by robertbu · Oct 01, 2013 at 12:28 AM

Since you did not post code, I can just give you some logic. Given the position of the two cylinders, pos1 and pos2:

 var midpoint = cylinder1.position + (cylinder2.position - cylinder1.position) / 2.0;
 cube.position = midpoint;

Height is a bit trickier since the build-in cylinder with y scale of 1.0 is two units high.

 cube.localScale.y = cylinder1.localScale.y * 2.0;


Comment
Add comment · Show 2 · 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 $$anonymous$$ · Oct 01, 2013 at 12:37 AM 0
Share

Thanks for the code I'm gonna test it out real quick.

avatar image $$anonymous$$ · Oct 01, 2013 at 01:16 AM 0
Share

I can't test today

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

13 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

Related Questions

Multiple Cars not working 1 Answer

How do I rotate a circle of objects so that a specific object is in front of the camera? 2 Answers

When I rotate my player in open 3 space, the transform rotation component keeps snapping back to origin. However, when I disable my rigidbody.rotate command, the transform rotation works just fine. 0 Answers

Help with Character Controller 1 Answer

Object Rotation/Character Speed 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