dongju.jeong Posted March 8, 2021 Share Posted March 8, 2021 (edited) setAnimaion(0, 'path'); or int id = addAnimaion( 'path guid'); setAnimation(0,id); The results of these two methods look the same. Why use addAnimation()? Does play() function just run layer 0 animation? Edited March 8, 2021 by dongju.jeong Link to comment
karpych11 Posted March 9, 2021 Share Posted March 9, 2021 Hello, I would recommend using addAnimation("path.anim") when you need to work with a lot of animations on different layers and you don't know in advance which layer which animation is on. At the initialization stage, it is convenient to add all animations and remember their id. If in logic on one layer, depending on the states, there can be different animations, then it will be convenient to reassign them by id. And yes, the play() function just plays the animation on layer 0. 1 Link to comment
dongju.jeong Posted March 10, 2021 Author Share Posted March 10, 2021 thank you. When I try to apply the same animation to different types of objects,Should I use the addAnimation() function individually?For exampleint aID = object1->addAnimation("anim1_run"); // object1 : soldier_Rifleint aID2 = object2->addAnimation("anim1_run"); // object2 : soldier_RPG Link to comment
silent Posted March 10, 2021 Share Posted March 10, 2021 I believe that's would be a correct approach. Do you have any issues with that? How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts