Hi,
I’m new in this forum. I’ve a simple question. I simulate a parallelepiped in 2D game. When I increment Z scale of the parallelepiped for example :
transform.localScale += Vector3(0, 0, 1F);
the parallelepiped 's height increments on both sides in Y direction according to its gravity center. My question is : how can I do to fix the base of the parallelepiped and increment its height on one direction only ?
Thanks in advance and sorry for my English.
Yass_
You could try making your object a child of another game object, with a local offset so that the parent’s centerpoint is where the child should scale from. Then scale the parent instead of the child.
Thank you very much jeffreyschoch for your suggestion.
I’ve found another solution. I measure the displacement of a bottom vertex of my parallelepiped when I increment its Z scale and then I apply the same displacement to its point center.
1 Like