Forum Discussion
ShardNZL
7 years agoExplorer
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??
3 Replies
Replies have been turned off for this discussion
- bkjAdventurerOn mobile most time is spent loading big textures.
- ShardNZLExplorerhmmmm - 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();
}
} - PAaltoExpert ProtegeThat code snippet does not show where you add items to the BoxColliders list? I assume you do that somewhere.. :)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 10 months ago
- 1 year ago
- 4 years ago