Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
more ▼

asked Jan 27 '15 at 11:35 PM in Blueprint Scripting

avatar image

21 1 4 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first


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

Hope it helps!

jumpactor.png (89.8 kB)
more ▼

answered Jan 30 '15 at 10:16 AM

avatar image

1.8k 76 19 143

avatar image fallout2023 Feb 01 '15 at 06:16 AM

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. :)

alt text

dajumps.jpg (184.9 kB)
avatar image eXi Feb 01 '15 at 11:19 AM

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.

avatar image fallout2023 Feb 01 '15 at 04:06 PM

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.

alt text

jumpitembp.jpg (169.1 kB)
avatar image eXi Feb 01 '15 at 04:10 PM

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.

avatar image fallout2023 Feb 01 '15 at 04:19 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question