I generate a random dungeon at startup and there I apply a check for the possibility of placing a room if there is no other method already there using the Physics.OverlapBox or Physics.CheckBox method, but this does not work, I also tried placing it in the first update and this also does not work, and only after The 2nd frame is checked.
Tell me why this is and how you can initially use the physics test?
private void Awake(){
CreateDangeon(); // create and check collision
}
private void Start(){
CreateDangeon(); // create and check collision
}
private void FixedUpdate(){
if(boolStartPhysic){
boolStartPhysic = false;
CreateDangeon(); // create and check collision
}
}
all 3 methods do not work, only after the 2nd frame it starts working…
private byte boolStartPhysic = 2;
private void FixedUpdate(){
if(boolStartPhysic != 0){
if(boolStartPhysic == 2){
boolStartPhysic = 1;
}
else{
boolStartPhysic = 0;
CreateDungeon();
}
}
}
this is the only option that works