teddybear082 / CrueltySquadVR-Modloader

A VR Mod for the Steam game Cruelty Squad, made with the Godot Game Engine, GodotXR asset and Godot XR Tools asset
Do What The F*ck You Want To Public License
27 stars 2 forks source link

Not tied with this mod: ui in 3d scene #18

Closed Hexadotz closed 1 year ago

Hexadotz commented 1 year ago

I know i shouldn't be doing this but i couldn't find any other place to contact you, I've seen that you managed to make ui work in 3d space and i was wondering if you could share the files maybe or make its own project, the thing is im not using vr and would like to implement it in just 3d games in general wether vr or not so i hope that you respond

teddybear082 commented 1 year ago

I don’t mind!!

I use the code from this repository, Godot XR tools, the Viewport2Din3D, for it: https://github.com/GodotVR/godot-xr-tools/tree/master/addons/godot-xr-tools/objects. (You will see three components of it in that folder, for Godot 3 you can use the Godot 3 branch instead of 4).

However, that implementation is also VR specific and I think the approach was inspired by an open source example for flat screen games, found here:

https://godotengine.org/asset-library/asset/129

good luck!

Once you have reviewed this if it answers your question please go ahead and close the issue out, I don’t want to do it myself until I know you’ve been able to read the response.

Hexadotz commented 1 year ago

Thanks and sorry for the late reply, although i tried it and same problem persists, the Buttons location is messed up and gets more messed up when i change the screen did you encounter this? If yes how did you fix it but if not thanks for the help ill close the repository but i really need to know what you did and im sorry if im a pain in the ass

teddybear082 commented 1 year ago

oohhhh. you need to set the resolution of the viewport 2din3d screen to match the size of the 2d scene you are putting inside of it. For example if your 2d scene is 1280x800 that should be the resolution of the viewport2din3d screen (should be an export variable for this) and it should be a mesh size that is roughly those proportions.

Hexadotz commented 1 year ago

Nope dosent seems to fix it entirely the buttons are still messed up, still i have to make the screen size match the viewport resolution somehow for it to work but at least now i got a clue as to how this thing isn't working thanks for the help tho sorry for the annoyance