I have no idea what I'm doing, but I know I'm doing it wrong.

Warning: This may be by far the worst thing you have ever seen. I’m tired.

I have used C++ for maybe a week or two now, and just now came to Unreal. When I saw the blueprint system, it confused me fully. I’m trying to learn it, but it still flabbergasts me constantly. I have no idea what I’m doing, but according to Unreal Engine 4, i’m doing it very wrong. A lot of the tutorials i’ve seen include nodes that aren’t in BP anymore, and most of the updated tutorials feel confusing, disorderly, and hard to understand. A lot of the “tutorials” just give you a blueprint and say “Here use this” without ever describing how it works.

I figured I would start with something very “simple”. Making a ball roll, and being able to turn it left and right to control the direction it rolls in. I created a new level, popped a sphere in. I then went to Project Settings and made two action mappings. One is “Turn Right”, bound to Right, and one is “Forward”, bound to Up. I figured I would just invert “Turn Right” later to make “Turn Left”. I clicked on the sphere in the viewport, then under Details I clicked Add New Blueprint. I tried to think of it in terms of just coding with C++ from scratch, kind of making it flow in the order I want things to be checked on / called / happen. So, I tried this:

And even though this whole blueprint thing confuses like all hell, I can still tell there’s something very wrong with this. I just don’t know what exactly.

Basically my logic here is this:

Input Action - As long as “Right” is Pressed down, then it will delay by 0.1 (So it just feels like its repeating, so you don’t have to spam Right to keep rotating). Then, after the delay, it increments the rotation by 2.0 around the Z axis to turn it Right.

I’m not actually sure how the rotation node works, i’m just kind of guessing. If anyone can tell me why I’m so terrible at understanding blueprints that’d be great.

EDIT: I just realized the increment node has no value to increment. So just ignore that for now and tell me all the other reasons this is terrible :slight_smile:

Well you arent feeding the incremented value to the rotation either. Nodes to the left are “input” values (which changes the behaivor of the node) and the ones on the right are “outputs” (if applicable).

Im also concerned the delay will cause you problems.

Yep that is definitely very wrong there.

The “Pressed” event only occurs once, it’s not a held event.

To figure out if it has been held you will need to set a boolean variable and then use the tick event to check if it’s held. Set it to false when “released”

You noticed the int variable having nothing there so it can’t do anything anyway.

But the rotation you will just set the rotation to 0,0,1 each time you press it.

What you want to do is increment on it’s current value. So right click on the little purple circle on rotation and break the value out.

Then you want to get the actor’s current rotation, and then increment the Z axis by whatever amount.

All of this however is ill advised and not the way I would recommend doing this kind of thing. You would be worthwhile checking out the rolling ball template and see how they have setup their character controller.

Any of the Unreal tutorials on their Youtube channel will be very helpful to you and I highly encourage you to give them a watch, they have updated 1s for version 4.8+

Dont worry too much about not getting things the first time. This sorta thing just has a steep learning curve, especially if you have zero background

Thankfully, blueprints is incredibly forgiving for the new/uninitiated. Its alot of fun once you get used to the whole shebang!