Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] GUI elements in 3D world #175

Open
chriscamacho opened this issue Apr 22, 2024 · 5 comments
Open

[Suggestion] GUI elements in 3D world #175

chriscamacho opened this issue Apr 22, 2024 · 5 comments

Comments

@chriscamacho
Copy link

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
Copy link
Contributor

aronand commented Apr 23, 2024

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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)

@frendship-loost
Copy link

frendship-loost commented Nov 17, 2024

To resurrect this topic a bit, I experimented with implementing a version of this "GUI in 3D" myself. The Cogito player UI elements can block input sometimes, and there are some range concerns where you'd probably want to tie the screen's usage radius to an Area3D.

In the end, I un-did all of this work and re-designed my SubViewport screens to work with CogitoInteractions and Buttons instead of trying to capture mouse input. My scenes were simple enough that designing a whole additional system on top of Cogito didn't really make sense, and sometimes, using mouse input in a FPS game felt a little awkward. The interact components kind of provide anything you might already need, though I'm sure there are some niche applications for a true mouse input capture.

My example scene, where I just hide buttons inside of monitors to enable usage of their SubViewport UI.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants