I have no idea what it does and it is driving me nuts
It is how you return a value in a function!
Look inside the project, and you can figure out how it works.
so a return block is supposed to be used inside a function, but it has other uses too. So let’s say you have a function, and at the end of it, it has “return 0”. That function can now be used as a number for if statements, math blocks, etc. It exists so that you can condense complex formulas into a single statement. For example, you can have a function that calculates the player’s position or something, and have it return that value at the end. You can simply use that function as a number instead of copying the entire formula. If you click the minus button in the return block, it’ll return nothing. This can be used anywhere, and all it does is just exit the current function/block immediately. It’s not necessary, but it can be used to cut down on large if/else blocks.
hope this helps!
It lets you turn functions into the oval blocks you put in number parts
Returns the function itself.
Yeah, the return block doesn’t really make sense when you first see it.
Think of it like asking someone a question. If you ask, “What’s 2 + 3?”, the answer they give back is 5. A function with a return works the same way—it sends a value back to whatever called it.
For example, if you have a function that calculates a player’s score, using return lets the function give that score back so you can use it somewhere else in your code.
So instead of just doing something, a function with return gives something back.
@Richard what are the actual name for them I always called them bubbles but I’ve heard oval and circle too
the official name is the somewhat cumbersome “reporter blocks”, which i’ve always hated.
i just call 'em blocks with return values, or sometimes “expression” blocks
OMG richard just talk on my post.