Hi,
im wiriting a Ludo in 3D in C# in Unity 5.
I want to save all the positions on gamefield where the player can move in a vector3 array.
I did it so:
public class gameController : MonoBehaviour {
public List<Vector3> playgroundForRed;
void start () {
List<Vector3> playgroundForRed= new List<Vector3>();
// here i want to fill the arrayList with positions of gameobject I made for every position the player shall move (SFeld is the gameObject where the player can move)
rotesSpielFeld.Add(GameObject.Find("SFeld1").transform.position);
rotesSpielFeld.Add(GameObject.Find("SFeld1").transform.position);
rotesSpielFeld.Add(GameObject.Find("SFeld2").transform.position);
}
Then after the dice roll a 6 the player shall move out of his base to SFeld1 position: i did it like this in update():
GameObject.Find("PlayerR1").transform.position = rotesSpielFeld[0];
But this don’t work. The player doesn’t move.
I realy don’t know what I have to do now…
On the otherside I tried to save every single position direct in Unity like this:

and
The player jump to the Green Base 
(This position isn’t saved in the vector3 array) - there is no position where he moved ^^
But the Player has to go to the first red field on the Playground.
But when I write
GameObject.Find("PlayerR1").transform.position = GameObject.Find("SFeld1").transform.position;
The Player move to the right position, but then I would have a problem on the nice dice roll.
Thats why why I thought to save the positions in the array so i can “just” add the dice number to the next index.
I realy hope someone can help me…
Best Regards!!
Luke
public List<Vector3> playgroundForRed; void Start(){ playgroundForRed= new List<Vector3>(); } & you are adding elements to
– Ali-hatemrotesSpielFeldnotplaygroundForRedNo Sry, you misunderstood me. In the Code the name is always rotesSpielFeld - I just translated it here once and forgott the rest. So your answer was just a hint for wrong Translation here -.-
– LakishHey, thank you for your comment. I don't have a problem with the fact that it lags when my laptop is not plugged in, but I do have a problem that my game lags on mobile phones..... Please could you have a look at this asset: https://www.assetstore.unity3d.com/en/#!/content/59187 When you play it on mobile, it LAGS.... Why is this? It is only a SIMPLE 2D mobile game? Where games like the real color switch run completely smoothly?
– daniel_lochner