(2021-03-15, 0:15)Walt White Wrote: As soon as I launch the LUA script, the Axle1 sub-model jumps to a new position on the first frame. It also loses the 13° rotation that allowed its 14 tooth gear to mesh correctly with the Axle2 gear.This is how it supposed to work
The setRotation function constructs a new rotation matrix (stored in the ori variable).
You then assign this matrix to the type 1 reference line of 'Axle1.ldr' by doing this you will overwrite any existing rotation.
If you want to keep the initial orientation you will need to buffer it in the start event and then multiply it with the one before assigning it to the reference.
But it is much more practical to make sure the reference is orientated correctly while using the 1 0 0 0 1 0 0 0 1 rotation matrix.
You can do that by rotating the parts in the submodel them selves.
You can see this is also the case in my second animation demo video at 2:45
Hope this clears things up.