Closed hugojobe closed 2 years ago
Hello! Are you using the latest version of Edgar? What version of Unity do you have?
Are you doing something non-standard with the generator? Because the error looks like your room data got somehow corrupted and it's weird that it would happen only after the Fog of War is trying to reveal the room.
How are you running your setup? Is it all while in play mode or are you generating your level inside the editor (without play mode) and then entering the play mode with an already generated level? Because that could at least lead to some weird serialization issue.
Does the error happen right when you generate the level or do you have to do some extra steps?
Does the FogOfWar example that's inside the examples folder work for you?
Hi I use the latest version, yes and I have Unity 2020.3. I think I don't do something strange in my rooms, they look like a square or L-shaped The error happened after I added the FOW component and all it's setup... I generate my rooms in play mode. The error happen right after room generation and, I think, before or while FOW generation.
Thanks
After the error happens, can you please look at the "Generated Level" game object and there's a field called Room instances
and in each room instance there's Outline Polygon
-> Points
:
Your error indicates that there's a room instance which doesn't have at least 4 points in the array. Can you please check if you can find such room?
All my rooms have 4 points or more...
I have the error even with 1 room in my level :
Weird. Now I suspect there's a problem inside your FOGTrigger script. Can you please show me the insides of the script? I suspect that there might be some serialization issues or something like that.
Or if you can just zip the whole project (the Assets folder should suffice) and send it to me that could also help. It's always quite hard to do this "remote debugging".
I'll send you the whole project by email :) Wait a little bit while I upload all the files
I think I found the problem. In your room template prefabs, the RoomInfo (Grid2D)
component is attached to the root game object of the prefab. This later messes up the actual RoomInfo (Grid2D)
component that should only be added after a level is generated. In turn, your FOGTrigger script somehow uses an uninitialised RoomInstance
where the outline polygon is empty.
The solution is to go through your room templates and remove the RoomInfo (Grid2D)
component from the root game objects. After that, it should work.
Let me know if this fixes it for you!
I works thanks !
Hi ! I followed exactely the tutorial in the documentation but I get this error at runtime :
Can you help me please ?
Thanks :)