Voxelers / 3d

3D in Voxelers
Apache License 2.0
9 stars 1 forks source link

Add collision shapes to imported animations in Godot #65

Closed acs closed 1 year ago

acs commented 1 year ago

In order to interact the characters in the game, we need to add collision shapes the meshes into animations.

During the import animations process it can be done.

And with animations created in Godot, also. Let's explore all in this ticket.

acs commented 1 year ago

I have played a bit with it and the hints are working. Not sure yet howto combine both animations, the one with the mesh and the one with the collision shape. But I will research it later.

acs commented 1 year ago

To play several animations at the same time we need to use the AnimationTree.

It seems it is the AnimationTree what we want to use: https://godotengine.org/article/godot-gets-new-animation-tree-state-machine.

But it seems we need to play a bit with it to understand the best approach. But our case is fairly simple: execute the normal animation and the collision animation at the same time. But they are imported from different files. Let's see how to combine all together.

acs commented 1 year ago

Time to learn the Animation Tree. Let's create two simple animations in Godot and join them using the AnimationTree. A complete tutorial about it: https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html

acs commented 1 year ago

I have tested that if you have an animated mesh, the collision shape related is also animated, so it works as expected: the collisions will be detected with the animated mesh. Cool!