Search Unity

Spawn max amount of objects on plane

Discussion in 'AR' started by ACWesterberg, Aug 20, 2019.

  1. ACWesterberg

    ACWesterberg

    Joined:
    Oct 21, 2018
    Posts:
    11
    Hello!
    So I've been playing around with ARFoundation and AR in general for a while. I tried to edit the script PlaceMultipleObjectsOnPlane so that it will spawn a max amount of objects before stopping. I tried adding a simple Integer after if Input.touchCount > 0, for example, i < 10 to prevent it from happening after 10 objects have spawned, by having i++ after each object has spawned. But it continues to allow me to spawn in objects. Any ideas to why and how can I get around to fixing that issue?

    I tried making the integer higher than, for example 10. Which ended up with nothing spawning, as it should.

    Thanks