{"name":"Arma 3: UVAnimations","title":"Arma 3: UVAnimations","type":"topic","url":"https://community.bistudio.com/wiki/Arma_3:_UVAnimations","revid":376475,"updated":"2025-10-16T22:33:38Z","aliases":["Arma 3 UVAnimations","UVAnimations"],"markdown":"Arma 3 v1.84\n\nUV animations, in contrast to regular animations, are not part of model.cfg but main vehicle configuration.\n\nTheir usage is pretty similar to typical animation created in model.cfg (see Model Config) but there are few differences:\n\n- translation, rotation & scale is supported\n- animate and animationPhase are not supported by this tech - use animateSource and animationSourcePhase instead\n- it is using sections instead of bones\n- UV animations can be stacked - animating same section by multiple animations will result in multiplication of matrices\n- order of UV animation matters in case single section is animated by multiple animations\n\n### Configuration\n\n```cpp\nclass CfgVehicles\n{\n    class TestVehicle\n    {\n        // UV animations are defined in vehicle config & they are not baked to p3d in contrast to regular animations\n        class UVAnimations\n        {\n            // You can name it whatever you like since it is not working with animationPhase or animate command\n            class TestAnimation_01\n            {\n                type            = \"translation\";\n                // name of source, either custom one, defined in AnimationSources class or regular model.cfg source\n                // It can be animated with animateSource & value can be retrieved via animationSourcePhase\n                source            = \"Test_Source\";\n                // section name from model.cfg sections[] array\n                section            = \"camo1\";\n                minValue        = 0;\n                maxValue        = 1;\n                // Transformation of UV coordinates\n                offset0[]        = { 0, 0 };\n                offset1[]        = { 0, 1 };\n            };\n\n            // Example animation using gmeter sources\n            class TestAnimation_02\n            {\n                type            = \"translation\";\n                source            = \"gmeter\";\n                sourceAddress    = \"loop\";\n                section            = \"camo2\";\n                minValue        = 0;\n                maxValue        = 1;\n                offset0[]        = { 0, 0 };\n                offset1[]        = { 1, 0 };\n            };\n\n            // Example rotation animation\n            class TestAnimation_03\n            {\n                type            = \"rotate\";\n                source            = \"Test_Source\";\n                section            = \"camo2\";\n                minValue        = 0;\n                maxValue        = 1;\n                // [x, y] - coordinates defining center of rotation\n                center[]        = { 0.5, 0.5 };\n                // angles are in radians just like in model.cfg\n                angle0            = 0;\n                angle1            = rad 30; // rotate by 30 degrees\n            };\n\n            // Example scale\n            class TestAnimation_04\n            {\n                type            = \"scale\";\n                source            = \"Test_Source2\";\n                section            = \"camo2\";\n                minValue        = 0;\n                maxValue        = 1;\n                // [x, y] - coordinates defining center of rotation\n                center[]        = { 0.5, 0.5 };\n                // 1 means that there will be no change to the UV\n                scale0[]        = { 1, 1 };\n                scale1[]        = { 2, 2 }; // make UV map twice as large\n            };\n        };\n\n        class AnimationSources\n        {\n            class Test_Source\n            {\n                source            = \"user\";\n                initPhase        = 1;\n                animPeriod        = 0.3;\n            };\n\n            class Test_Source2 : Test_Source {};\n        };\n    };\n};\n```\n\n### Example\n\nIn the following example you can see how the Kart's chain animation was done.\nUV animation is synced with right rear wheel via animation sources creation tech which was introduced with Arma 3 Jets' PhysX suspension.\nIt is possible to get damper values too this way.\n\n#### config.cpp\n\n```cpp\nclass CfgVehicles\n{\n    class Kart_01_Base_F : Car_F\n    {\n        class AnimationSources : AnimationSources\n        {\n            class Wheel_2_2_source\n            {\n                source = \"wheel\";\n                wheel = \"RR\";\n            };\n        };\n\n        class UVAnimations\n        {\n            class Chain\n            {\n                type            = \"translation\";\n                source            = \"Wheel_2_2_source\";\n                sourceAddress    = \"loop\";\n                section            = \"Chain\";\n                minValue        = 0;\n                maxValue        = 1;\n                offset0[]        = { 0, 0 };\n                offset1[]        = { -1, 0 };\n            };\n        };\n    };\n};\n```\n\n#### Model Config\n\nNote the \"chain\" section!\n\n```cpp\nclass CfgModels\n{\n    class Vehicle;\n    class Car : Vehicle\n    {\n        class Animations {};\n    };\n\n    class Kart_01_F : Car\n    {\n        sections[] =\n        {\n            \"camo\", \"camo2\",\n            \"zbytek\",\n            \"Number_a\", \"Number_b\",\n            \"wheel_1_1_hide\", \"wheel_1_2_hide\", \"wheel_2_1_hide\", \"wheel_2_2_hide\",\n            \"chain\"\n            // here\n        };\n\n        class Animations : Animations\n        {\n            // Example of custom animation source using it\n            class wheel_shaft_2\n            {\n                type            = \"rotation\";\n                source            = \"wheel_2_2_source\";\n                sourceAddress    = \"loop\";\n                selection        = \"wheel_shaft_2\";\n                axis            = \"wheel_shaft_2_axis\";\n                minValue        = 0;\n                maxValue        = 1;\n                angle0            = (rad -0);\n                angle1            = (rad +360);\n            };\n        };\n    };\n};\n```\n\n### Scripting\n\n- animateSource\n- animationSourcePhase\n\n### See Also\n\n- Model Config","sections":[{"heading":null,"level":1,"markdown":"Arma 3 v1.84\n\nUV animations, in contrast to regular animations, are not part of model.cfg but main vehicle configuration.\n\nTheir usage is pretty similar to typical animation created in model.cfg (see Model Config) but there are few differences:\n\n- translation, rotation & scale is supported\n- animate and animationPhase are not supported by this tech - use animateSource and animationSourcePhase instead\n- it is using sections instead of bones\n- UV animations can be stacked - animating same section by multiple animations will result in multiplication of matrices\n- order of UV animation matters in case single section is animated by multiple animations"},{"heading":"Configuration","level":3,"markdown":"```cpp\nclass CfgVehicles\n{\n    class TestVehicle\n    {\n        // UV animations are defined in vehicle config & they are not baked to p3d in contrast to regular animations\n        class UVAnimations\n        {\n            // You can name it whatever you like since it is not working with animationPhase or animate command\n            class TestAnimation_01\n            {\n                type            = \"translation\";\n                // name of source, either custom one, defined in AnimationSources class or regular model.cfg source\n                // It can be animated with animateSource & value can be retrieved via animationSourcePhase\n                source            = \"Test_Source\";\n                // section name from model.cfg sections[] array\n                section            = \"camo1\";\n                minValue        = 0;\n                maxValue        = 1;\n                // Transformation of UV coordinates\n                offset0[]        = { 0, 0 };\n                offset1[]        = { 0, 1 };\n            };\n\n            // Example animation using gmeter sources\n            class TestAnimation_02\n            {\n                type            = \"translation\";\n                source            = \"gmeter\";\n                sourceAddress    = \"loop\";\n                section            = \"camo2\";\n                minValue        = 0;\n                maxValue        = 1;\n                offset0[]        = { 0, 0 };\n                offset1[]        = { 1, 0 };\n            };\n\n            // Example rotation animation\n            class TestAnimation_03\n            {\n                type            = \"rotate\";\n                source            = \"Test_Source\";\n                section            = \"camo2\";\n                minValue        = 0;\n                maxValue        = 1;\n                // [x, y] - coordinates defining center of rotation\n                center[]        = { 0.5, 0.5 };\n                // angles are in radians just like in model.cfg\n                angle0            = 0;\n                angle1            = rad 30; // rotate by 30 degrees\n            };\n\n            // Example scale\n            class TestAnimation_04\n            {\n                type            = \"scale\";\n                source            = \"Test_Source2\";\n                section            = \"camo2\";\n                minValue        = 0;\n                maxValue        = 1;\n                // [x, y] - coordinates defining center of rotation\n                center[]        = { 0.5, 0.5 };\n                // 1 means that there will be no change to the UV\n                scale0[]        = { 1, 1 };\n                scale1[]        = { 2, 2 }; // make UV map twice as large\n            };\n        };\n\n        class AnimationSources\n        {\n            class Test_Source\n            {\n                source            = \"user\";\n                initPhase        = 1;\n                animPeriod        = 0.3;\n            };\n\n            class Test_Source2 : Test_Source {};\n        };\n    };\n};\n```"},{"heading":"Example","level":3,"markdown":"In the following example you can see how the Kart's chain animation was done.\nUV animation is synced with right rear wheel via animation sources creation tech which was introduced with Arma 3 Jets' PhysX suspension.\nIt is possible to get damper values too this way."},{"heading":"config.cpp","level":4,"markdown":"```cpp\nclass CfgVehicles\n{\n    class Kart_01_Base_F : Car_F\n    {\n        class AnimationSources : AnimationSources\n        {\n            class Wheel_2_2_source\n            {\n                source = \"wheel\";\n                wheel = \"RR\";\n            };\n        };\n\n        class UVAnimations\n        {\n            class Chain\n            {\n                type            = \"translation\";\n                source            = \"Wheel_2_2_source\";\n                sourceAddress    = \"loop\";\n                section            = \"Chain\";\n                minValue        = 0;\n                maxValue        = 1;\n                offset0[]        = { 0, 0 };\n                offset1[]        = { -1, 0 };\n            };\n        };\n    };\n};\n```"},{"heading":"Model Config","level":4,"markdown":"Note the \"chain\" section!\n\n```cpp\nclass CfgModels\n{\n    class Vehicle;\n    class Car : Vehicle\n    {\n        class Animations {};\n    };\n\n    class Kart_01_F : Car\n    {\n        sections[] =\n        {\n            \"camo\", \"camo2\",\n            \"zbytek\",\n            \"Number_a\", \"Number_b\",\n            \"wheel_1_1_hide\", \"wheel_1_2_hide\", \"wheel_2_1_hide\", \"wheel_2_2_hide\",\n            \"chain\"\n            // here\n        };\n\n        class Animations : Animations\n        {\n            // Example of custom animation source using it\n            class wheel_shaft_2\n            {\n                type            = \"rotation\";\n                source            = \"wheel_2_2_source\";\n                sourceAddress    = \"loop\";\n                selection        = \"wheel_shaft_2\";\n                axis            = \"wheel_shaft_2_axis\";\n                minValue        = 0;\n                maxValue        = 1;\n                angle0            = (rad -0);\n                angle1            = (rad +360);\n            };\n        };\n    };\n};\n```"},{"heading":"Scripting","level":3,"markdown":"- animateSource\n- animationSourcePhase"},{"heading":"See Also","level":3,"markdown":"- Model Config"}],"categories":["Arma 3: Editing","Introduced with Arma 3 version 1.84"],"groups":["Modding"]}