hello, i am making a party game like Mario party or Wii party and i have a problem with the player movement. The problem is that the players need to go to an specific square depending on the number that he/she get, I tried too much things and after a lots of ideas I got stuck. Here is the code, but is incomplete becouse i have no idea how to finish it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class movement : MonoBehaviour
{
int numberofmovement;
public bool isonMobile;
public Button m_PlayBtn;
public GameObject c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13;
public GameObject wtg;
public Text text;
void Update()
{
if(isonMobile == true)
{
m_PlayBtn.onClick.AddListener(TaskOnClick);
}
else
{
if (Input.GetKeyDown(KeyCode.Space))
{
ThrowAnumber();
}
}
}
public void TaskOnClick()
{
ThrowAnumber();
}
public void ThrowAnumber()
{
numberofmovement = Random.Range(1, 13);
text.text = "" + numberofmovement;
Move();
}
public void Move()
{
gameObject.transform.position = wtg.transform.position;
}
}