Help! I was tryng out unity pro and I switched one of my game’s platforms to android but when I did my scripts broke and I got errors like
‘transform’ is not a member of ‘Object’
I switched my platform back to normal and my scripts are still broke! My scripts were fine until I switched platform.
Any on ideas on how I could fix this?
It is difficult to tell the reason of that error message without looking at your code. How did you defined that Game object? It could be because while you switched for the first time, the variable that is related to that Game object got re-defined to the switched platform style, and when you switched back your platform, it didn’t re-re-defined those variables. Try to debug the lines of your code that is related to that game object or that specific transform.
Instantiate(Balls[PlayerPrefs.GetString(“ballcolour”)], ball_spawn.position, ball_spawn.rotation); new_ball.transform.name = “Ball”;
I take it you’ve created PlayerPrefs key “ballcolour”?
Clearly, instantiate is returning an object. So cast it to a GameObject.
new_ball = Instantiate(...) as GameObject
I found out that my platform was then set to Flashplayer :o I switched it back to web player and it works!! Thanks guys for your support. Oh and “as GameObject” did work but I don’t need to do that now(and there were other errors).