[/INDENT]
I’m trying to make the object’s position to be between “Wheel1” and “BackSusTop”, then i want the x-scale of the object be identical to the distance between “Wheel1” and “BackSusTop”, and i want the objects rotation to point at both “Wheel1” and “BackSusTop”.
The positioning works just fine, but i can’t get the rotation and scaling to work at the same time.
If i removes the rotation in the script, the scaling works. But when i add the rotation, then scaling is suddenly ignored.
Why can’t it both scale and rotate?
Translate the distance to a scale relative to the width of the object. For example, if the width of the object is 10 and the distance between “Wheel1” and “BackSusTop” is 20 then you need a scale of 2 or:
RSG: I don’t think that will work, because the entire scaling progress is being ignored. My current method works fine, as long i’m not trying to use the rotation
But i can try giving it a shot later, when i’m home from work
Sorry for bringin back this, but I have a similar problem and I’m totally lost.
I have an object that should look to a child of another gameobject (which parent rotate a small angle from one side to the other like a windshield wiper) and a the same time it should scale so it looks like it’s conected to that parent object.
The look part I got it with transform.LookAt(target); But the scaling thing can’t make it work.
The original scale of the object is (1,1,1). When the target moves, the distance between the pivot of the obect and the target changes. I’d like to use that variation for scaling the object on the z axis, but I don’t know how.