Doom-like enemy sprites problem

Hi all,

I got a question. I’m making some doom-like enemy sprites. That means that we got a sprite, but when we move around it, you can see the left side, back, right side and front again. I’ve already completed that part and the sprite is always facing me.

But the problem is when the enemy is chasing me and moves to the west or east (read sideways) from himself, I want to see the side of him. I made 8 flipbooks with animations, so in this part I need to see the side animation. So when the enemy chance it’s yaw, it’s means I need to see another flipbook. But the yaw is already used for facing the camera, so when chancing the yaw the sprite turns and the flipbook is still the same.

I’ve got the blueprint of the 8 angles for the flipbook if you want it, but I used this for the basics

I hope you understand the problem, because it’s hard to explain.

Cheers Dave

I would recommend a clear separation within your blueprint. Instead of having your sprite be the root of the blueprint, create a separate root and a make the sprite a child of this root. This way you can control the location and orientation based on this root object and have the logic for the orientation of the sprite separated and only applied to the sprite itself.

Hey Arnage,

thanks for the reply.
That’s a good idea and I’m going to try to make it work now. I will let you know the result.

Update:

Ok, I made 2 blueprints 1 parent and 1 child. I put the sprite of the enemy in the child blueprint. I got 2 lines of code: the first one is that the enemy is always facing the camera. The second one is the 8 directions of the enemy. The first line I’ve to call it in the parent (right?). The other line of code shall I put it in the child? Because it’s calls the flipbooks of the sprite and every child can be an other type of enemy. But I’m still missing the line of code where the enemy is facing the direction to the point he walks to. Who can help me?

Thanks in the advance