Accurate surface tracking / ground detection

What is the best way to ensure that my scene is placed on the ground? I don't want just any surface. Sometimes my scene spawns in the air, which totally breaks the experience.

Also, I need to know that the scale is accurate. 1m in my scene should be 1m in reality. Is there a way to force this behavior?

Best Answer

  • vtang
    vtang Posts: 6 👻
    #2 Answer ✓

    Hey Joshua,

    I would recommend checking out the true size object template for getting your scale consistent. Floor detection is a bit inaccurate without Lidar. If you want to go that route, you can find an example in the SpawnerSetup script from the World Mesh Template which only spawns object based on the surface type.

    Cheers,
    Vincent

Answers

  • Joshua Beckwith
    Joshua Beckwith Posts: 18 🔥

    Super helpful info, thank you! I pulled a few scripts from the true size template and it seemed to help a lot. I am running a hit test continuously during a placement phase, and always storing the lowest detected position. Unless the user is on some super uneven ground, it should work as a good detector for ground level.