Variable types you just kinda have to remember but there isn’t that many of them.
bool
or boolean
stores only two values, 0 or 1, on or off, true or false. Think of it like a light switch.
int
stands for integer, it stores only whole numbers, 1,2,3,4,5…100,200… and their negatives as well.
float
stores any numbers with decimal places, used when higher precision is required.
string
stores text
vector2
and vector3
are structures that hold 2 and 3 float
s respectively.
Those are the only ones you should really think about for now, once they click so will any others you encounter moving forward.
Get and Set are coding prefixes for methods used to either extract or input data for an object (class/struct).
Any method that begins with “get” will be used to read some value while ones that begin with “set” will be used to, well, set said value.
For example, a GetPosition()
method would return the current x:y:z coordinates of an object while a SetPosition()
would be used to set the values of x:y:z.
Within an object’s class it could look something like this:
Vector3 position; /* Vector3 stores three values, in this case the x y z coordinates of position */
public Vector3 GetPosition()
{
return position;
}
public void SetPosition(Vector3 newposition)
{
position = newposition;
}
public void SetPosition(float x, float y, float z)
{
position.x = x;
position.y = y;
position.z = z;
}
We have a variable of type Vector3
declared for storing objects position, appropriately named position
, then we have a GetPosition()
method to retrieve what’s stored in that position
variable.
Next we have a SetPosition()
method, you can see that in its the brackets there is a Vector3 newposition
, that’s because when we use (or call) the method we want to pass in the new values for the position
variable inside our class. Inside the SetPosition()
method we simply assign the newposition
vector passed in through the method to the position
variable.
Underneath I also included a secondary version of the method (an overload) in case the user would want to input the x:y:z position one by one as float
variables.
The “get” and “set” prefixes are a standardized coding practice used by programmers, in theory, you don’t have to use them and could name the methods something like retrivePosition()
and applyPosition()
and they would work the same, but it would be confusing for anyone but the person who wrote them like that.
So when you see a “Get” it means you’re getting a value and “Set” means you’re setting one. Easy and simple.
As for the sequence node, I didn’t actually know what it was myself so I just looked it up on Unreals documentation:
Sequence Node
It explains it pretty well there.
I can’t see what it’s doing in the context of your course but its purpose is to just trigger a sequence of events in succession. There is no perceivable delay in the execution but the order is always preserved.
This may matter if you need to ensure things are being done in the correct order, like calculating something before spawning an object.