Hi I’m not 100% sure on where to post this as it could ve “just” physics, animation or Scripting issue, so sorry for that if I posted this here wrongly.
I’m creating an Interface for my 1:1 size R2D2 build (communication through BT over Pi and Arduino)
anyway I need to simulate the 2-3-2 Legs Transition .
FYI this is not mine just to show what I need to simulate,
Unfortunately my R2D2 model is not rigged, and I don’t know how to do it and even don’t know if it would help.
I have 10 game objects:
R2D2 (Pivot point on center)
------->Dome (Pivot point on center)
------->Body (Pivot point on center)
------->Legs
-------------->Left leg (Pivot point on shoulder)
--------------------->Left foot (Pivot point on the ankle)
-------------->Right leg (Pivot point on shoulder)
--------------------->Right foot (Pivot point on the ankle)
-------------->Center leg
--------------------->Center foot (Pivot point on the ankle)
The transition from 2 to 3 legs would be: (Dome + Body + Center Leg) rotate together 18° on the X axis
at the same time the center leg move out to a certain position(until the center foot touch the ground)
as soon the center foot touch the ground it needs to go forward until the 2 legs (left and right) build a 36° degree on their X axis (Pivot point on the shoulder), the feet (left and right) need to stay fix on the ground and only the legs rotate 36° degree on the shoulder and of course the Ankle needs to rotate accordantly.
So basically I would like to know how to move objects simulant at the same time it would help, as I thought I use Coroutines, with something like this:
void Update()
{
if(Input.GetMouseButtonDown(0))
{
StartCoroutine(Set3LegMode());
}
}
IEnumerator Set3LegMode()
{
while(Body degree != 18)
{
rotate Body(); ===>I would need to rotate all except the 2 legs left & right
moveOutCenterLeg(); ===> move the Center in Y axis to certain by specific Offset
yield return null;
}
rotateCenterFoot();
while (LegShoulderXAxis degree != 36)
{
rotateLegs();
rotateAnkel(); ===> with an offset accordently to the shoulder rotation
yield return null;
}
}