- Home /
Change the transform scale based on direction of motion
Hello,
I have a physics object that moves around my screen at various velocities. I want to stretch my object along the direction of motion with an intensity related to its velocity.
I have no problem relating scale to velocity, the problem is I don't know how to change the x,y,z of the scale to relate to the direction its traveling.
In short: How do I scale an object in the direction of its motion.
Um, if I am driving a car, and it stretches the faster I drive, then doesn't it always stretch in the axis which points from the back of the car to the front, that it, the direction I am looking out the front window in. If that's the x-axis, then I'd stretch the car in the x-axis, always.
I see what you mean.
However I should have noted that while the object can travel in any direction. It's rotation will remain fixed.
Your answer
![](https://koobas.hobune.stream/wayback/20220613181945im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rotation and Velocity of bullets. 1 Answer
uGUI keep position and size of GUI elements when anchors change 3 Answers
How to change 2D x direction on button press and keep velocity 1 Answer
Saving default transform of an object c# 1 Answer
Transform.position.x jumps to high numbers after collision 1 Answer