Help with smash bros like game

i cant figure out how to make it so when i hit the dummy from the left so he move to the right and the other way around i need help

In the last two events, add 2 subevents to each of them that checks the X position of vitamin relative to percentage_test using the compare numbers condition:

  • if vitamin.X() < percentage.X() then apply a positive force
  • if vitamin.X() > percentage.X() then apply a negative force

I will test it when I got time thanks

@MrMen i tried it and it makes the test fly way to far so i changed some numbers and it still doesnt work what could i do to fix it?

Can you screen shot the events applying the forces?

@MrMen here is the screen shot

Did you add platformer character behaviour to object (uncheck ‘Default controls’) and make sure there’s a platform beneath percentage_test? It should look a bit better and not fire the object too far away.

I already did that it didn’t work

Could you video what it looks like? I’ve tried it with a simple set up and it seems to work, but maybe what I’m expecting is not the same as you.

E

That’s how it works for me. Can you describe how else you expect it to appear?

It waits until I fire another bullet before the percentage starts flying in the air so I can fire a bullet and it hits then I fire another then he takes damage like he is supposed to

So it’ll be because one of the conditions is not met. Either p2_percentage is greater than 20 or less than 0, or p2_hit is false.

What happens when a bullet is fired? Is p2_percentage reduced? Is only one bullet being fired at a time?

You also don’t have a condition for p2_percentage > 20, like you did in the screen shot in the first post. Maybe you’ll need to add that in case p2_percantage is more than 20.