Hello
I am a total newbie to Unreal Engine 5.
I am following a tutorial to make a simple ball game. The tutorial shows how to move the ball forward, backward, and left and right, but no jumping.
I tried to make the ball jump, and I somewhat able to make it jump.
However, whenever I press the spacebar, the ball keeps jumping even mid air, and I do not want that.
I want the ball jump once, then only able to jump again when it’s on the ground.
Could anyone help me to do this?
I attached 2 blueprint images. One is to show how I did those forward/backward movement, and another image is a close up shot of “jumping” blueprint.
Could you be a bit more specific how to line trace downward and set it up?
Where do I connect the line trace? I also noticed that there are several types of line trace, like for object, by channel, or by profile…
I am an absolute beginner…
So you can use a Line Trace By Channel and set the channel to “Visibility”.
This means the line that goes out will return something if the line is stopped somehow.
To do it downward, you’ll want to plug in “Actor Location” with the ball as the target as the start vector, and for the end you’ll take that same actor location, make a “+” node, and add to the Z part of the vector- however long you want it to be, but it needs to be further out than the ball’s surface.
Then you take the return value bool(the red line) and make a branch- if True continue to the jump code, if False, do nothing.
This will all go AFTER spacebar input action, but BEFORE get ball ref.
Let us know if you run into any issues, and bring pictures like you did before, it really helps!
Thank you so much for your detail reply.
I am still kind of lost what I need to do.
I tried to do as what you suggested, but I failed…because I just do not understand Blueprint.
Could you look at the image below, and correct me what I did wrong?
So what you’re doing with the start and end points, is you’re creating a line between two points. If you want it to go down from the start, you need negative Z values, because Z is up and down. Right now you’re drawing a line up because the Z value is positive on the + node.
Basically how a line trace works is it tries to see if it can draw the whole line start to finish without running into anything that blocks it, and here it’s going by visibility from point A to point B. The floor should stop it, which gives a return value of true, and will allow you to jump. Just change that +Z to a negative value so the line draws down instead of up!
That was my bad, I said “add” thinking of only how line traces work instead of how you would be using it.
@Mind-Brain
Thank you so much for the reply, and thank you for being patient with me.
So I change the + node to - node, and set the Z value from 5 to 300, but the ball still jumps multiple times whenever I press spacebar.
I searched other jump topic, and someone suggested to add “Radius” node, and set it to + 5, then connect it to Z value. I tried to find “radius” node, but I could not find it…
There are bunch of radius nodes, and I am not sure which one to use?
Anyway, here is the blueprint image…
I feel like I need to learn the basic of blueprint first, that way I understand when experts like you suggest me what to do.
I was just following a “making speed ball game” tutorial, and the tutorial has no jump, and I tried to make jump function by myself.
Since I have no ideas how blueprint works and never learned about it, I am just lost.
I even do not know how to set up the duration 0.25 like you suggested.
I have been trying to make it jump without continuously jumping for a week.
I searched online, but I could not find the answer.
I never expected that making a simple jump is this hard.
At this point, I will just finish making this game without jumping.
Thank you so much @Mind-Brain since you are the only person who tried to help me, and I am sorry I could not make it happen.
I will just finish the tutorial, and done with it, then I will find basic blueprint tutorial to understand it better.
I really, really suggest this one! It covers LOADS of stuff- everything you want and some you didn’t know you wanted! It covers basic-intermediate topics on blueprint of a wide variety, and after you’re done you have something to show off a little!
I wish you luck @gorillajin and don’t forget that we’re here if you get stuck!