Phazorknight / Cogito

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

[Suggestion] GUI elements in 3D world #175

Open chriscamacho opened 2 months ago

chriscamacho commented 2 months ago

There is an example with Godot (GUI in 3d) that shows using a standard set of GUI controls, by hacking in some event injection you can make it work with a captured mouse, I implemented in my own experiment a door that needs you to enter a 4 digit password to open the a door (alas only just discovered this project or would have hacked it into this!), the number keys and clear buttons are all just the standard Godot button controls, but they are rendered into a viewport texture. Taking the world position of a raycast hit you can then do an affine transform to get the position you need to inject the mouse event into 2d gui.

aronand commented 2 months ago

Yeah this would be a nice addition, I've seen something similar implemented here: Immersive Sim Interaction System in Godot Specifically at around 1:40.

chriscamacho commented 2 months ago

I need to.do some more tidying with my own code base, but would I be wasting my time implementing this idea and making a PR for this project not just my own?

Phazorknight commented 2 months ago

I've seen something similar implemented here

Yup, that one is pretty cool. Someone already pointed it out and asked the same question before.

would I be wasting my time implementing this idea and making a PR for this project not just my own?

As it stands right now, I'm not planning to work on a feature like this myself. If you can make an Object/Component that works with Cogito, feel free to make a PR, and I'd love to merge it in. It would not replace the current Cogito Keypad, as this one has some other features that wouldn't work with a diegetic interface, and since it also works as an example of a "minigame interface" in general.

chriscamacho commented 2 months ago

to be honest I've only started looking at Godot again since 3.0 days, I'm not fully up to speed with GDScript its missing some features like Interfaces I'd expect from an OO language, and I'm not 100% sure I'm holding it right at the moment !

So maybe better I wait till I've got a little more comfortable with the language, but in the mean time...

You can see it running here: https://www.youtube.com/watch?v=VsiehuPLULE I can give you the whole project to play with if you like... Just contact me via my website... (see github profile)