I made a struct:
public struct Line
{
public Vector2 start, end;
public Vector2 vectorLine {get{ return end - start;}}
}
But whenever I try to instantiate it like I do with a Vector class
Line touchSwipe = new Line ();
Unity returns this error:
You are trying to create a MonoBehaviour using the ‘new’ keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all