Skip to main content
Up and Coming
December 15, 2018

Adding colliders by List Loop - after load - would that decrease load time significantly?

Just a general Unity knowledge query....
I have scenes with 50-60 mesh/box colliders in them. In some scenarios I don't need them so I thought why not make a list of GameObjects that use them and then on scene load check to see if they're needed and apply one per frame. I believe that if you turn them off in the editor and on by script that Unity recreates them form scratch anyway?
Would this significantly reduce load time since it'll only be loading geometry/lighting etc - and 60 colliders per second shouldn't slow down the page load??
This topic has been closed for replies.

3 replies

Up and Coming
December 18, 2018
On mobile most time is spent loading big textures.
BOOL VR Games
ShardNZLAuthor
Up and Coming
December 30, 2018
hmmmm - any insights into why this isn't working?? .....
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
....
public BoxCollider bc;
public List<GameObject> BoxColliders = new List<GameObject>();
....
void Start () {
StartCoroutine(drawBoxes());
}

public IEnumerator drawBoxes(){
foreach(GameObject data in BoxColliders){
bc = data.AddComponent<BoxCollider>();
yield return new WaitForEndOfFrame();
}
}







Up and Coming
December 31, 2018
That code snippet does not show where you add items to the BoxColliders list? I assume you do that somewhere.. :)
Working on LineWars VR: http://linewars.patrickaalto.com/LWVR.html