Can't get a Dynamic Component to work. Please help! 😟

Hello,

I’m trying to trigger a double “onclick” animation within a dynamic component but I’m having trouble understanding relative starting positions and I can’t get the script to function properly. I can manage a single onclick without problems but once I put the 2 components into a “master” component, it seems to become too complex for my brain…
Model in question is a height adjustable electric desk. I’m trying to animate it going upwards from a default starting position of 75cm above ground plane(measured from the surface of the tabletop to (0,0,0) origin point in SU). It should travel 30cm up and stop at 105cm above the origin point.

However there’s also a second moving part, namely the middle legs, which travel 15cm instead of 30.
I have put all the axes of all moving components onto the default origin point of the 3D scene.

The 2 components work as expected on their own while I am inside the master component. However once I exit and try to trigger the animations from the outside, their positions get messed up:

If anyone could have a look or explain what I’m doing wrongly, I’d be very grateful.
I have seen several really complex onclick animations online, but the explanations are never detailed enough to recreate them.

Good morning
I prefer, in the case of multiple animations, to animate a number and that the elements which must transform are based on its value.

In the case of your table, the difference between the two states of the table is 30 cm. So, I decide to animate a “hauteur” attribute between 0 and 30.

The mobile part which includes the plate will have its starting height in the low position increased by the value of the animated number.
z=7 + table!hauteur

The telescopic reinforcement tube will have its starting height increased by half the value of the animated number
z=7 + table!hauteur/ 2

1 Like

Animações múltiplas são chatas mesmo!
Exige que seus eixos estejam bem estabelecidos.

Tente explorar a função SET() e mesclar com ANIMATE().

Para animações assim vc pode mudar o valor atributos personalizados ao invés de mudar X,Y,Z.

Ou até mesmo mesclar com IF()

1 Like