Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Endless Runner - Platform Creator

Discussion in 'Unity Certification' started by jenkinskn, Jan 17, 2021.

  1. jenkinskn

    jenkinskn

    Joined:
    Dec 14, 2020
    Posts:
    3
    I am on module 6 of the User Cert course and I’m having trouble with the platform creator. I can’t get all the platforms to be created at the same Y axis on the screen. Also having overlap issues. I have 9 platform prefabs, but when they are randomly created, the orientation height is different for most of them, the larger ones overlap with the initial platform and/or other platforms, and the larger platforms are being destroyed before the player reaches the other side of that platform.
     
  2. Yeoman742

    Yeoman742

    Joined:
    Dec 30, 2020
    Posts:
    7
    Ok, I did some testing.. First open your first prefab platform, you should have the transform, box collider and platform script attached as components, ensure that your Position and Rotations are zero'd out and scale set to 1 for all axis. whatever your art work you used should be children underneath that gameobject. Each child should have a transform, sprite render and sprite-default material, you will need to line up the left side of the first image to the center y axis of the parent gameobject.
    upload_2021-4-3_15-52-38.png
    if you want to resize the images or move it, do so in the child. You want to also resize your box collier to match the image in the parent gameobject. Also ensure your starting position X for you ReferencePoint is somewhere off the screen or you will see the platform created and that in your script, the platform script has the transform.position.x < (whatever value you need off the screen). if you followed the videos word for word, you might consider -10 or -15, test this out yourself to see what value works.
    Please let me know if this works for you.
     
    Last edited: Apr 3, 2021