Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Proper way to "stream" collider (physic shape) entity in a large scene?

Discussion in 'Physics for ECS' started by hauwing, Mar 13, 2021.

  1. hauwing

    hauwing

    Joined:
    Dec 13, 2017
    Posts:
    69
    Hi, I am just wondering what is the proper way to "stream" the objects' colliders (physic shape) as the player is approaching that object? I think this is a very common problem in FPS and racing game with a large terrain where you need colliders for trees etc. I am thinking whether I should break down into difference subscenes just like what the Megacity demo is doing but that demo is pretty much unplayable now even if using an old Unity 2019 version so I can't really see it in action. Or I should simply instantiate/destroy the entity according to the player's distance? What is your experience? Thanks.
     
  2. milos85miki

    milos85miki

    Joined:
    Nov 29, 2019
    Posts:
    197
    Please see UnityPhysicsSamples/Assets/Tests/StreamingStressTest as an example. If you're interested in detailed pros/cons of each possible approach, I'd recommend asking on DOTS subforum (parent of physics).