I have a tree rotating complexly. It’s welded to a rotating sphere. I want to adjust the height of the tree. I dont want to enter how much to grow/shrink the tree, I just want to enter the final size of the tree along the y axis, and keep the base of the tree on the surface of the sphere.
part:Resize() requires the increment (1 makes it bigger by 1, not equal to 1), not final size. I found the maths to make it work, subtracting the final size by the current size i think, however the answer is usually a fraction, and the function requires integers.
Since its at weird angles i cant just move the Y cframe up/down, and im not sure how calculate what the x y and z must be at any angle.
Help?
Images:
Small tree meshes welded to a mesh sphere in a viewport
Game running, viewport audio-vizualiser running, making meshes bigger depending on the loudness of the music, on a rotating planet. Meshes are longer as expected but are growing symmetrically instead of the bottom remaining on the planet’s surface.
Could you include some pictures of what you’re trying to do? I’m a little confused by your description and I think we might be able to help better if you can show us what you want to do w/ a picture.
I added images now, im making a simple audio vizualiser on my main menu. Need the trees’ Y size to grow while their base remains on the planet’s surface. They are at an angle so I can’t just move them higher in the Y position.
The CFrame data has three vectors that can help. They are LookVector, UpVector, and RightVector. The UpVector tells you which direction the top of the model is facing - and it’s a unit vector of length one. So if you want to grow the tree by 0.5 studs, you just take the old CFrame and add 0.5 times the UpVector.