I have a question about the trigger and touch events. I need to setup an event when the player jump on a crate.
The crate need to explode when the player fall on it after jump (like Crash Bandicoot).
How can I doing that with the Event Graph or anyway whitout any C++ programming ?
The setup is like that : Player going to crate, he jump on the crate and the crate explode.
I need to detect when the player touch the crate after his jump and activate the animation of the explosion.
You can try to make a trigger box on top of the box, and a collision box at the player’s feet. When the collision box enter the trigger box, check if he is falling. (OnBeginOverlap event).
Unfortunately, even though the Platform behavior can enable a double jump without a sequence of events, there’s no function to check with the player is on his second jump or at the first one.
So what I suggest for you to try is this, create a variable to determine how many time the player have pressed the jump button and set its value to zero.
Then create a Keyboard object at you game layout, and then back to the event sheet, create a event trigger “On key pressed” and select the key the player is using to jump, the default key is the up arrow.
In this function set it to add 1 to the value of your variable. This means every time the player press the jump button the value of you variable will increase.
Then set a condition using “system” and “compare two values”, to check if the value of your value is equal or higher than 2. And as event to that set the player animation to the double jump one.
Remember to set the value of your variable to 0 every time the player lands on the floor, and if you are using a “player is jumping” to trigger you animation, use a sub-event (press S). That would be a condition like this, if the player is jumping > goes to sub events. Variable = 1 > do jumping animation, Variable >= 2 double jump animation.
I’m not quite sure if there’s a better way to do it or if there are any plugins for that, but I would do it like this.
UE4 has a jump apex function/node, which is the height of a jump.
You are use that and/or determine if the player is going +1 with gravity, i,e falling.
You can put a trigger on top of the crate, and check the normal of the player actor touching it.
(I think) If the normal is 1, then the trigger was interacted from above (jumped on)
This is not really UE specific, it’s how most game dev is done.
Well … I really tried to understand how it works. But I got so used to working with the CryEngine … So I’m lost and I really do not understand how to connect the dots between-them. Does anyone could be kind enough to show me a screenshot of the graph to achieve? This would enable me to understand how the components communicate with each other.
I created and placed a box collision at the feet of my character (In His Blueprint), I added an event “OnActorBeginOverlap” to the box trigger placed on the crate. But after I really do not understand what node I need to use to detect that the player has jumped on the crate. Also, I added a little debug to check the behavior of the trigger and I noticed that the debug text when I was posted near the crate, then it should not be displayed. Conversely, when I jump on the box, there is no message. Yet my trigger is smaller than the box so I do not understand