I’ve been looking everywhere for tutorials or anything like that, and have found absolutely nothing to help me with this issue. I want to program the ability to do a side somersault or side flip in a 3D Space. Where you’re running one direction, but quickly move the opposite direction and press the jump button to start a side somersault.
The best way I can think of is to make a Boolean that determines if you meet the conditions to do one. But I haven’t been able to figure out how to program that.
If there is any helpful tutorials or advice anyone can give me, I will greatly appreciate it.
Hello! Did you get an answer to this question by the way? Also looking for this! Been scouting everywhere, can’t find anything either! Recently been working on my Mario Character Blueprint, this is one of the last ingredients that i need to make it smoother: https://youtu.be/5jwjE0SmoUA
Here’s one way you might do it, but might require some tweaking on to make it feel right, or maybe it’s not really a good way at all. I would maybe look for tutorials about doing 180 turns while sprinting to see how people go about coding that logic and maybe it would be better but this is a quick take on it.
Basically, we want to store the previous input value and the current value and take their dot product to determine if the player has done a “flick” where they were moving one direction but suddenly changed direction. The closer to -1 the dot product is, the more exactly opposite the flick was. For WASD this will probably always be exactly -1, for controllers you might have to do some testing, this may not even work at all or maybe you might need to normalize the vectors before taking the dot product, not sure honestly.
The < value is the threshold/leniency of the flicking action to trigger the somersault and the delay is how long the player has to do a somersault once they do the flick. Using a retriggerable delay so the delay starts over if the player does another flick, otherwise the delay on a previous flick could unprime our somersault on a more recent flick.
That would be nice wouldn’t it? Seems the magicians don’t want to give up their “tricks” so easily…
Well you got to break this down into steps. 1. At the moment you hit jump, rotate the mesh on the Z, like 180 degrees / - 180. Now…you got to work out how to rotate the mesh around and do all that before you come back to the ground. This rotation I think will be on the Y now.
You could only start the Y rotation after you have achieved a certain height from the starting or pre jump Z. Or base it on time.