How to Autojump after hit something

Been looking at the Platformer example for a while now, and can’t seem to figure out how they got the player to jump, (and at the right height no less), if you hit an object or wall.

If you know what they did to make that happen, be a sport and clue me in. As it stands, I’m pretty clue-less.

Hi,

I create a blueprint from StaticMeshActor and add this graph to handle hit event

Hope it helps!

I tried this exact thing and got no result. It was like nothing was there. I switched the wire to “Cast Failed” and disconnected “As Character”, and got this weird perma-jump thing going on. Really, with the “Event Hit”, should I expect any less? Unless the “Hit” was just from X vector, wouldn’t I get endless jumping anyway?

If you know what went wrong, (maybe I need to dig deeper), let me know.

Anyway, here’s a pic of my little change, that made me have more jump than a box of frogs. :slight_smile:

That’s because his setup was on the OTHER actor. That’s why he takes “other” and casts it to your Character.

What you are doing there is: Collide with something? Check inside the Character Blueprint if the Other Actor (with which you collided) is of type Character and if yes (not cast failed) JUMP.

So what you want to do is just remove that “Cast to Character”. You are not hitting a Character, so the Cast Fails and the Jump gets called. You just think that this solved your Issue, but if you would run into a character, you wouldn’t jump.

SideNODE: If you want to cast to your specific character, use the Name of the Blueprint. For this it SHOULD be “Cast To MyCharacter”. But anyway, just remove the castnode.

I see. I did make an invisible mesh, that I think, is doing this same function as this. I used a random mesh, made it invisible, then set it next to the wall face I should have jumped over. It’s crude, but it works to an extent.

In this game, the player would be moving forward, constantly, and jumping over obstacles. If you miss a jump, and smack a wall, the game takes a second to play a “rebound” animation. This should be when the auto jump function gets called.

So I guess the question is: do I have to have “Event Hit” BP for every wall I hit, or can the Character BP know that when X velocity = 0, that it should jump?

The most beautiful example of this mechanic, is in the “PlatformerGame”, from the marketplace. I just could see how it was done.

Anyway, here’s my invisible jump item.

Hm, i guess enabling the JumpThings at the correct time whould do enough.

But i would make a Blueprint with a Box component rather then using an invisible mesh.

I almost think that, within the Unreal “PlatformerGame”, the “BlockingVolume” boxes are doing the same thing. But I can’t see what they’re made of.

If nothing else, that’s may be what it’s going to come down to. A “BlockingVolume” of my own.