Collision not following skeleton mesh when animation

Hello.
I have done a tutorial on how to make a game.

and i would like to add some additional things.

I have created a simple box animation in Blender but i have some problems with the collision not following the skeleton mesh.

Cube.mkv (1.4 MB)
Don’t know how to opload a video that will play on this site…

Your video doesn’t play but I have some guesses on what your objective might be.

  • To make the capsule component and your character move together during an animation, you’d need to have the “Enable Root Motion” checkbox ticked in the Asset Details window of your animation asset. Keep in mind that your character needs to have a ground anchored root bone in order to make root motion to work, and this setting will not affect your other animation assets.
  • If you’re talking about a collision box you’ve added to your character staying still as you move your character by giving inputs, make sure that it’s added to your character blueprint rather than another actor blueprint.
  • If you mean your character’s collision capsue (or the box collision you’ve added) doesn’t seem to do anything, you check the collision settings and make sure they’re set to block / overlap / ignore your expected objects accordingly.

@VisAgilis Thank you for your reply, without the video it’s a little hard to help me. I can’t get a video to play but somehow a download link works.

My problem is that i have a cube that’s is moving and the cube needs to be smaller so it can fit under another cube. The cube animation plays when the “S key” is hit. But when the mesh is getting smaller the collision box is not getting smaller. Or it’s gets smaller i guess but not vertical with the center point at the ground, as it’s should, instead the collision box gets smaller horizontal at the center of the mesh.

You can upload your video to YouTube and send it’s link, though if the only thing you want is to adjust the transformation of your collision box, it should be this:

There’s also ways to make the transition smooth but I think this would be all you need since you mentioned that you have a shrinking animation for your visible character. I plugged in the Set World Transform node into a custom event but you can trigger it however you like. For debugging purposes, make it trigger on a simple button press and don’t regrow the collision box just yet to see this code being executed successfully.

If there isn’t a misunderstanding on my side, you described the issue as the invisible collision box of your character not getting transformed unlike your expectations, is that right? What were your steps on reaching that conclusion? Was your character still unable to fit in a certain space? Did you make sure to shrink your collision box enough?

Though before trying out my suggestions, there’s a much more important aspect that you should take into account, which I believe is why you’re experiencing this issue. Your player character which is currently a box, that is probably a static mesh, also has it’s own collisions. Other than the additional box collision you’ve added to your blueprint, there’s another collision volume that is the exact size of the bounds of your cube. That collison won’t get affected by your animation since animations are just a representation of what characters are doing rather than the physical characters. If you want to disable it, you can just change the “Collision Presets” setting of your static mesh like this:

Screenshot 2024-10-17 231200

Hope this helps! :blush:

hello again. Thanks for the answer, much appreciated.

I have tried some of your suggestions but with no luck.
I think you are right about the mesh collision, so i tied with another approach.

I made a skeleton mesh and applied some scale nodes. But it’s seems that Simulate Physics, Impulse and Scale do not work together.
When i disable Simulate Physics the Scale nodes works but then Impulse node don’t work, so the cube doesn’t move forward.
When i enable Simulate Physics the Impulse nodes work and the cube moves forwards but then the scale doesn’t work.

The wonderful world of game dev, right? =)

Why are you using the impulse node for? From my understanding, it seems like your objective is to be able to be able to move your cube rather than throwing it. If it’s the player character, you can achieve that using the Add Movement Input node. If you want to launch your character forward (or any other direction), you can use the Launch Character node. If it’s another character, you can use the Simple Move To or any other Move To node to move it (though you’d need to have a Nav Mesh for that) or if you want to launch it, again, you can use the Launch Character node for that. And if it’s just an actor, you can move it by using the Add Local Transform node or any other transformation node. I think your objective is not throwing it, so you don’t need the physics to be enabled for that :innocent:

Hello again.

This time with great news! It’s works =)

The reason that i tried to use the Impulse node is because that was what the tutorial taught me. I’m a noob to this game dev stuff. So i’m grateful that you could help me and point me in the right direction.

So just at follow up of what i did wrong and how i got it to work…

First problem was my approach, I thought that the mesh collision would shrink with the animation but that’s not how it’s works.
So instead i used some scale nodes to scale the whole Cube blueprint down.
But the Scale did not want to work with Simulate Physics and Impulse wont work without Simulate Physics and the Cube won’t move forward without Impulse.
So then i tried with the “Add Movement” node but that did not work.
Found out that i was using an Pawn blueprint and not an Character blueprint and when i changed that, the “Add Movement” worked and because of that i don’t need Impulse and Simulate Physics to move forward so the Scale nodes works.
I did also use a Skeleton Mesh and not at Static Mesh but i don’t know if that makes a difference.

I hope that makes sense and that I have understood the problems and the solution correctly.

Yes you got those right! :blush:

The reason adding movement input works with the character blueprint is because it needs the movement component for that, but like I mentioned earlier, there were also ways to make it move while keeping it as a normal actor. But of course the player character should be a character blueprint, I just wanted to remind this for the future when you need to move other actors as well.

So I think no issue remains now, is that right? Was your last post just to double check you understood everything correctly?

Yes, everything works now and yes, it’s was to check if I have understood correctly =)
Also maybe it could help other people with same problem even though my headline sucks…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.