Special death like pacman [resolved]

hello. I would like to achieve a death in that way as in the gif. when having contact with my enemy, this is a little pause and thus the death animation is activated and my enemies disappear. How do i do it? Thank you

pacman-video-game

I’m not sure if your requirement uses Paper2D, but the code basically the is the same.

Add a collision component to both to your character (PacMan) and enemy (Ghost). This is so they can collide each other.
image

  • In your character blueprint (PacMan) add a begin overlap event, either to the actor or the collision component.
  • Cast the collided actor, to check if it is your Ghost enemy.
  • Stop the game to wait for the animation (this is specific to each project gameplay style).
  • Use the delay node to wait a few seconds before starting the animation
  • Play the animation (Mesh, Skeletal Mesh, PaperFlipBook, etc.)

You must add some code compatible with your project, to stop the game and wait the animation to finish.

1 Like

hello. I’m doing a pacman game in 3d. I am a beginner in unreal. place the nodes but I don’t understand when you refer to your code to stop gameplay here and your code to end game here. This is what I have put up so far. Thank you

Your code is right.

What I mean by “stop the gameplay”, is because, as you can see in your GIF, the other Ghosts stop moving when the player is hit. Also, the game stops accepting controller input (keyboard, gamepad, touch, etc.), so the player can’t keep moving PacMan after hit.

I can’t show how to code this part because it’s specific to each project design. You could for example, disable input, get all Ghosts, and create a function in Ghost Blueprint that makes them stop moving around, but I not sure if it is close to your user case, this is specific to how you designed your project’s code and logic.

1 Like

how did you place this event?
Pacman’s dying animation has no bones.
If you are available I will share my project by private message

I managed to make the nodes but it still didn’t work for me, what am I doing wrong?

Show us your blueprints.

You’re getting all the ghosts (fantasmas?) but not doing anything with them.

What else is not working about the above?

Of course, I don’t know how to continue there, I don’t know how to place an event for the ghosts.

Create a Custom Event in the Ghost blueprint. You have a movement method for your ghosts already, surely? Have that custom event terminate it. It’s called Stop Moving above - it’s up to you to implement it. We do not even know how your ghost move.


Apart from that - does the script even execute?

what I have the ghost is an artificial intelligence. in blueprints I have nothing




captura4

If your ghosts are Pawns and have a movement component, you can:

no, he’s not a pawn, he’s an actor

Does not matter, there’s the movement component right there. It’s being used to move the the ghost around.

still the same . If you don’t mind, can I send you my project?

captura6

Sure - if it’s UE4.

But are you calling this event?

i have eu5 :grin:
no, what do i call it?

Now that you have an event that is supposed stop the movement - call it here:

image

and how did you write?