Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Mman1235 · May 25, 2016 at 02:58 PM · 2dpositioninstantiate prefabstretchpoint-and-click

prefab instatiating in a certain position, size and rotation?

For a little personal project I am working on currently, which is a sort of puzzle game. the player has the functionality to 'place a line' for important game reasons.

This line is a prefab of a 2d rectangle, which has a texture of a line pointing towards one end.

What I want to do,

is basically have the player pick 2 vector2's on the screen named 'from' and 'to',

and have this prefab instantiated just between them and have both its size,rotation and position be based on the placement of the 2 vectors.

With the line's end pointing towards the 'to' vector position.

If I could get some base for an idea and/or code on how to make this work would be great help!

I already know how to instantiate a prefab in a certain position,

but this demands far more variables to think about which I am not familiar with how they will affect what I need to add in the code for it to be as needed.

Also this stretching and rotating needs to be able to adjust itself since in the project, the 'to' and 'from' vector's are going to be able to be moved on a 2d plane, so the line needs to adjust too at the same time.

Thanks, if you need more details or I didn't explain what I am asking properly please ask :)

alt text

connector-line.png (3.1 kB)
Comment
Add comment · Show 2
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 IgorAherne · May 25, 2016 at 11:32 PM 0
Share

Consider this lesson: https://www.youtube.com/watch?v=TwZH-aoSzJk

avatar image Mman1235 IgorAherne · May 26, 2016 at 09:07 PM 0
Share

I watched some of the lesson not all of it (it's quite long haha) and went over a few of the subjects which are all really nice, interesting and explained very well :)

But I didn't see anything that relates to my question, unless I didn't see the part that talks about this concept.

Thanks regardless :)

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Advanced placing position from the same angle of target position 0 Answers

Draw on a Plane surface with varying camera positions 1 Answer

Create a semitransparent panel behind an ui element and behind one gameobject but in front of another 0 Answers

Changing the placement of circular motion in 2D? 1 Answer

Animation changes constantly reset themselves. 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