My enemy collision problem (resolved)

hello. I tell you. My character does not have AI. It just moves forward with its animation. The problem is with Physics. When I add physics it’s like it collapses but when I remove physics it moves normally but flies and only collides with Mario. any suggestions?
here with physics

[image]

cap1

here without physics

cap3

  • try not to combine physics with a movement component, it can be a tricky combo to work with
  • ensure you have the colliding component at the root of the actor, currently you do not
  • add negative Z to your movement vector to emulate gravity
2 Likes

I managed to give it gravity but it has no collision, I added a collision box but it has no effect. I tried several types of collision but it always gives the same result.

cap5

Please read above about the root component. It is incorrectly nested in the hierarchy. The colliding element must be made the root for the movement component to work correctly with collision. Drag it there.

  • Collision (root)
    • Goomba

FloatingPawnMovement

Also, your collision is Overlapping All while it should be Blocking? Or how do you want it to work? What is responsible for detecting collision here?

The box or the skeletal mesh? Or both? And what kind of collision are you expecting? At least the root collision must be blocking for the FPM component to kick in.

1 Like

there I modified but the goomba continues going through blocks and the ground

Please read again about the root component, it’s still incorrectly set up.

1 Like

great, we are about to achieve it

cap8

The problem is gravity, since if I connect it with the z value, goomba when colliding with something bounces and is thrown away

cap9

but if I take out the gravity, it bounces with the blocks but I would have to support it on the floor but it would lose gravity

cap11

Instead of just negating the vector, multiply it in such a way that the z value always stays negative.

Multiply it by 1, -1, 1 vector. I believe you’re only moving in Y here.

1 Like

there I added the multiplication in z but it continues bouncing, since it makes contact with any object and changes upwards

You have not multiplied anything. The node is not connected. And you still have Negate.

Yes, with that I get gravity but I would also like that when playing with a box, goomba goes back again or changes direction

cap8

Is there no possible solution? :thinking:

  • fixed by using movement component with physics - you just need to know the trick! :person_shrugging:The trick being Add Movement Vector + Physics Simulation allowing for taking advantage of the Floating Movement Component magic. A tad more work and tweaking but much more interesting behaviours can now be had. Plus room for more nuanced physical materials if ever needed.
  • regarding flipping rotation, it was a world axis issue, here the pawns move in X axis, not Y. So we move the pawn forward and simply rotate it instead.
1 Like

okay, thank you very much for the information, I’m going to try it. thank you :blush: