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 :)
Consider this lesson: https://www.youtube.com/watch?v=TwZH-aoSzJk
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 :)