As titled, what is it use for and could someone give me an example?
Hi, You can add animation components to the object you want to execute
There are many types of pre-designed animations here. You can refer to the documentation to learn more about the meaning of each of their properties.
Hi PT, thanks for replying.
I saw the documentation but it does not explain in detail how it works specifically. I added it into the scene but I do not know how to make it work effectively to aid the gameplay.
Perhaps you know how to use it effectively? if yes, please share some examples
Hi,
For example, in the project, if you want to rotate a 360-degree Earth object only along the x-axis and make it repeat, you can create a function.
function SetRotationEarth(world, eid, schemaAttribute, dur) {
ecs.RotateAnimation.set(world, schemaAttribute.cursor(eid).eidEarth, {
autoFrom: true,
fromX: 0,
fromY: 0,
fromZ: 0,
toX: 359,
toY: 0,
toZ: 0,
shortestPath: false,
loop: true,
duration: dur,
})
}
After that, you just need to call the function with the input parameters when needed. For example I want it to rotate around the x axis with a rotation time of 60 seconds
SetRotationEarth(world, eid, schemaAttribute, 60000)
Hope my code will be useful to you!
so how does custom vector3 come into play?