Trying to make a chess game. The floor tile script tells it’s position to the currentplayer script. I was hoping to then set the position of the current player to the tiles position. I get an error stating it does not contain a constructor that takes 1 argument.
Floor TIle script
public class FloorTile : MonoBehaviour {
private CurrentPlayerActions playerMoving;
public int moveSelected = 0;
void Start ()
{
playerMoving = GameObject.FindObjectOfType(typeof(CurrentPlayerActions)) as CurrentPlayerActions;
}
void Update ()
{
if (playerMoving.cPlayermovingEnabled == 1)
{
Debug.Log("FLOOR TILE SEEKING INPUT");
}
}
void OnMouseDown()
{
if (playerMoving.cPlayermovingEnabled == 1)
{
Debug.Log("Tile Clicked");
playerMoving.MoveHere(this.transform.position);
}
}
public void visibleMoveTiles (int activated)
{
}
}
Current Player Script
public class CurrentPlayerActions : MonoBehaviour {
public int cPlayermovingEnabled = 0;
// Use this for initialization
void Start () {
}
public void enableMoving(int addOne)
{
addOne = cPlayermovingEnabled += 1;
if (cPlayermovingEnabled == 1)
{
Debug.Log("MovingEnabled");
}
}
void Update () {
}
public void MoveHere (Vector3 tilepos)
{
print(tilepos);
this.transform.position = new Vector3(tilepos);
}
}