- Home /
How can I have a line stay between to points as one or both of them moves?
Hi I am trying to make a script that makes a box stretch itself to always touch two other boxes regardless if on or both of them moves, I have tried a lot of different things , I think I got the stretching working but when one of the boxes moves the box in the middle that stretches and rotates rotates out of course and don't stay between the other two boxes.
Answer by Orion 1 · Mar 12, 2010 at 10:35 AM
Maybe you can add the code you've been using so far so we have something to refer to?
It seems your problem is not the stretching but the rotation.
To make an object always look at another, use the example code here: Quaternion.LookRotation
$$anonymous$$y mis take was that I didn't rotate in localspace but in world space.
So maybe for sake of completeness you could post code of how you can actually have a line between two point when they move and mark the question as answered.
Your answer
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
Roatate animation starts from 0 2 Answers
How to select an animation clip by index number? 7 Answers
scaling bone animation of salamander tongue looks fine in max but breaks in unity 1 Answer
Can the animation editor create local rotational data? 3 Answers