Advertisement
Guest User

code

a guest
Aug 1st, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public void CreatePlatform(){
  2. Vector3 newPlatformPosition = oldPlatformPos;
  3. GameObject chosenPlatform = getRandomPlatform ();
  4. newPlatformPosition.z += chosenPlatform.GetComponent<Renderer> ().bounds.size.z;
  5. GameObject gameObj =(GameObject)Instantiate (chosenPlatform, newPlatformPosition, Quaternion.identity);
  6.  
  7. gameObj.name = "Platform#" + platformCounter;
  8. gameObj.tag = "Platform";
  9. platformCounter++;
  10. oldPlatformPos = newPlatformPosition;
  11.  
  12.  
  13. //GenerateObstacle
  14. CreateCubeObstacle (gameObj);
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement