I'm trying to find something out about variables. Please help!

Hi,

I’m trying to create a variable which does the equivalence of a Vector3. I need to store, for example an X, Y and Z.

I was thinking it could be done with a float like:

float[x,y,z] Coordinates;

However I know this isn’t what I want.

I’m trying to make it so i can use “Coordinates.x” for example.

I’m sure this is possible as I’ve come across it before but just can’t remember how.I’m using cor-ordinates here for an easy explanation of what I’m trying to achieve.

Thanks.

Make a struct or class:

public struct Coordinates {
    float x,y,z;
}
public class Coordinates {
    public float x,y,z;
}

Could also just use a Vector3 and call it Coordinates.

Vector3 Coordinates;