- Home /
How can I edit the horizontal layout group on a panel or object
I need the horizontal layout group to curve / rotate all the children like a hand of cards just like in hearthstone
if this is not possible another way to do this would help
Answer by IggyZuk · May 22, 2017 at 11:06 AM
You'll need to attach a new script to the same game object as HorizontalLayoutGroup
.
In this script – for each child of the transform you will lerp from one quaternion to another.
Something like this (untested) should do the trick:
float lerpValue = 0f;
float increment = 1f / transform.childCount;
Quaternion q1 = Quaternion.AngleAxis(150f, Vector3.forward);
Quaternion q2 = Quaternion.AngleAxis(30f, Vector3.forward);
foreach (Transform child in transform)
{
lerpValue += increment;
child.rotation = Quaternion.Lerp(q1, q2, lerpValue);
}
Your answer
Follow this Question
Related Questions
Why doesn't childing a gameobject to GridLayoutGroup at runtime align it properly? 1 Answer
Content size fitter alignment issue 1 Answer
Vertical Layout Group Not Behaving Even Close to Correctly 1 Answer
Tween animations when adding / removing from layout groups 0 Answers
Unity crashes when using ExecuteAlways on a UIBehaviour 0 Answers