Download

How exactly does the FLinearColor struct works?

When in blueprint, it copies all the parameters using only the set node ( without the need for a function that copies variable by variable ).
When looking inside of it in cpp, I can see a lot of logic inside of it, like:


FORCEINLINE FLinearColor& operator*=(float Scalar)
	{
		R *= Scalar;
		G *= Scalar;
		B *= Scalar;
		A *= Scalar;
		return *this;
	}

	FORCEINLINE FLinearColor operator/(const FLinearColor& ColorB) const
	{
		return FLinearColor(
			this->R / ColorB.R,
			this->G / ColorB.G,
			this->B / ColorB.B,
			this->A / ColorB.A
			);
	}
	FORCEINLINE FLinearColor& operator/=(const FLinearColor& ColorB)
	{
		R /= ColorB.R;
		G /= ColorB.G;
		B /= ColorB.B;
		A /= ColorB.A;
		return *this;
	}

But I can’t seem to find something that will represent the “Set” node in blueprint.
How can I achieve the same effect in my structs?

I could be wrong, but if I’m not mistaken then the “set” node is simply there because of the fact all of the variables are public.

If you’re talking about something else, you can always find out how the node is defined by right clicking the node and selecting “Goto Code Definition.”
A lot of the functions you see are defined as static inside a multitude of headers.