I worked through Anwell’s Flappy Bird tutorial using Unity3D 5 - http://anwell.me/articles/unity3d-flappy-bird/. Many thanks to him for posting this lesson. Since the tutorial was written using Unity3D 4 and I am using 5, I had to make one small change at the beginning to get most things to work. I ran into a road block when I tried to make the obstacles (rockPair) change their Y position randomly. This is near the bottom of the lesson. I get several errors when I add this line of code to the ‘obstacle.cs’ script:
transform.position = new Vector3(transform.position.x, transform.position.y - range * Random.value, transform.position.z);
Errors:
The name ‘range’ does not exist in the current context.
The best overloaded method match for UnityEngine.Vector3 … has some invalid arguments.
Argument ‘Number 2’ cannot convert ‘object’ expression to type ‘float.’
An object reference is required to access non-static member ‘UnityEngine.Transform.position.’
I tried several things with no luck. For now I have commented out the line and lived with the random Y position. Any suggestions would be appreciated. Thanks.