Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
853 stars 94 forks source link

Player exits crouching when opening Inventory or interaction GUI #283

Open OvercastInteractive opened 1 week ago

OvercastInteractive commented 1 week ago

Cogito and Godot Engine Version: Godot version: 4.2.2 Cogito version: beta 202409.03

Description: Interacting with a keypad while crouching locks you into the keypad UI (you can still exit it by pressing Esc)

Reproduction steps:

  1. Go into a crouch
  2. Interact with the archive keypad (it looks like you are immediately forced out of your crouch)
  3. Attempt to exit the keypad with the interact button

Expected behavior: The interact button works the same while not crouching, as a toggle that can enter and exit the keypad UI

Phazorknight commented 1 week ago

Thanks for flagging this. Looking into this a bit more, it seems this has nothing to do with the interaction.

If you are crouched when interacting -> opening a gui like the keypad, the player character stands up and thus the interactable object is no longer being hit by the interaction_raycast due to the position change. The interaction is not there anymore because the interaction raycast isn't hitting the object anymore.

That being said, I'd expect the behavior to be that the player character simply stays crouched when opening a GUI (like the keypad, readable etc.), so I'm looking into fixing that as part of the cogito_player.gd script. So far it seems more complicated that I thought, unfortunately.

Phazorknight commented 4 days ago

I'll probably have to undo some of the changes I applied to cogito_player.gd cause it seems like I've introduced some issues with the sprinting. Player doesn't stop sprinting when the sprint button is being let go, making it feel like they're floating a bit.

Phazorknight commented 8 hours ago

Renaming this issue to better describe whats going on.