Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
670 stars 72 forks source link

Opened doors break upon scene transition #181

Closed aronand closed 2 months ago

aronand commented 2 months ago

Cogito and Godot Engine Version: Godot: 4.2.1 Cogito: 6d9f37e

Description: Opened doors visually break if a scene is switched. This seems to impact all opened doors in one way or another.

Reproduction steps:

  1. Open all the doors in the first level of demo map
  2. Move to the laboratory scene
  3. Move back to the initial scene
  4. Observe that the doors now exhibit the following oddities: opened door looks closed, opened door's position is slightly wrong, or the opened doors position is so wrong, that it no longer shows up in the map.

Expected behavior: The doors should retain their position if their state has been altered.

Screenshots: closed_open_door Door looks visually closed, but state is open

cupboard_doors Doors look closed, but are also positioned wrong

vanished_door Door has vanished from the scene, most likely somewhere outside the level

aronand commented 2 months ago

In the original demo map, a lot of the pieces end up in the middle of the gun range section: demo_map_01

The drawers however seem to work as intended: demo_map_02

Unrelated to the doors, the note on the wall disappears even when nothing has been interacted with: demo_map_note

Phazorknight commented 2 months ago

Thanks for flagging this: was able to reproduce and am looking into it.

Phazorknight commented 2 months ago

Ok, this should be fixed in https://github.com/Phazorknight/Cogito/commit/2ee85030bba5f0e76bc18d432d0a00ed5184f966

When I implemented the state loader for the sliding door that can close automatically, I made that the default for ALL doors if they were open. This update fixes this and implements two methods that improve readability to set door states more easily.

aronand commented 2 months ago

Doors now seem to function as intended 👍 the note still disappears however, in both original and new test map (albeit of course that is not what the ticket is directly about).

Phazorknight commented 2 months ago

@aronand yeah, there's actually something weird going one with Cogito Objects that are based on StaticBody3Ds. Will make a separate issue about it.