

MidWayPointX = JumpTargetLocation.x - ((JumpTargetLocation.x - ) / 2) JumpTargetLocation = new Vector3 ( - jumpOffsetX,, ) GameObject previousStrip = strips as GameObject = new Vector3 (0, 180, 0) įloat distanceX = - JumpTargetLocation.x ī -= new Vector3 (distanceX, 0, 0) ī -= new Vector3 (distanceX, 0, 0) MidWayPointX = JumpTargetLocation.x + (( - JumpTargetLocation.x) / 2) GameObject nextStrip = strips as GameObject IndexOfTheHighestRoadStrip = stripsCurrentIndex ĭebug.Log("new score: " + indexOfTheHighestRoadStrip.ToString()) ScoreText.text = "Score: " + Score.ToString() If (stripsCurrentIndex > indexOfTheHighestRoadStrip)

GameObject newStrip = Instantiate (item,, ) as GameObject GameObject lastStrip = strips as GameObject Transform itemChildOfChildTranform = itemChildTransform.GetChild (0) as Transform įloat itemWidth = (). Transform itemChildTransform = (0) as Transform GameObject item = poolOfStripsPrefabs as GameObject Int randomNumber = Random.Range (0, stripsPrefabCount) Int stripsPrefabCount = poolOfStripsPrefabs.Length I tried to destroy the next lane when the player hit an obstacle and tried to cancel the movement, but its sens to crash or bug the game. Basically, when the player hit an obstacle going up, the game generates a lane, its ok, the problem is: if he hit the obstacle 3 times, go to the side and jump up without hitting an obstacle, the player will jump 4 lanes instead of 1.
