Trying to create a Goomba behavior with 2.5D plaftormer

Greetings

I’m working on a platformer where I’m already implementing obstacles and enemies. The most basic enemy behaves similarly to a Goomba from Super Mario Bros. The enemy is almost fully functional, except for its “bounce” interaction with objects.

I’m following this tutorial from Cobra Code (which is quite good), but I’ve gotten stuck on making the enemy detect an object, collide with it, and then turn back.

From the parent BP of the enemies, there’s a function set up to make the actor rotate 180 degrees. On the child BP of the first enemy, BP_Crab, I created an overlap event that triggers Turn Character when it´s collision box touches a static mesh.

The function itself:

The overlap event is detected correctly, but I’m unsure whether the issue lies with the box collision or the function being called in BP_Crab.

The Box Collision for detect walls in the viewport + collision setting

The event that works and the call function that’s now working

I’ve tried rewatching the class session twice, but I still haven’t found a solution.
Generate Overlap Events is active in the walls and box of the crab.

Hey @Naithsabes!

This is a GREAT question post! Lots of information one normally has to ask for, great pictures, too. However, there is just one thing I’m missing- When the crab reaches the static mesh wall, what does it do? Having that info could be the missing puzzle piece.

Get back to us soon!

Thanks for the kind reponse!

The crab stops when it hits the wall, but the box actually flips

So this is the logic behind the movement and anim switch.

So your crab IS turning 180 degrees! It’s just hard to notice because it’s flat.

The problem is possibly the “Get Forward Vector” on walk forward, I’m not sure that actually updates. Try using “Get Actor Forward” instead! :slight_smile: