so, my code;
Script one;
using System.Collections.Generic;
using UnityEngine;
public class mousePosTracker : MonoBehaviour
{
public Vector2 mousePos;
public void Update()
{
mousePos = Input.mousePosition;
Debug.Log(mousePos);
}
}
and script two;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class player : MonoBehaviour
{
void Update()
{
transform.Translate(// mouse position);
}
}
the code currently is pretty bare-bones, but I will fix that. so what I want to do is; I want to access the vector2 mousePos variable in script2, so that I can move the player based on the mouse position.