Facepunch / sbox-issues

161 stars 10 forks source link

WorldInput components #5031

Closed Guilhem-Pech closed 3 weeks ago

Guilhem-Pech commented 1 month ago

For?

S&Box

What can't you do?

Maybe I missed something but I can't interact with buttons or panel the same way if its a world panel or a screen panel

How would you like it to work?

I want to interact with world UI, be able to have UI buttons on them for example

We could:

Have a simple way to display a cursor on the panel?

image

What have you tried?

Made a simple razor file with a button in it Enable pointer events, works if its a screen panel but 0 effect if world

Additional context

No response

MrBrax commented 1 month ago

this (was) a thing with worldpanels before the scene update, i'm guessing it's going to be added back in

handsomematt commented 1 month ago

We have an API for this https://asset.party/api/Sandbox.UI.WorldInput but it needs some components for it

DevulTj commented 3 weeks ago

I've added a WorldInput component that handles basic interaction. It doesn't make UI elements for a fake mouse or anything.. I'm not sure if we should be doing that.

Put the WorldInput component on your camera, and it'll work.

https://github.com/Facepunch/sbox-issues/assets/22372616/b4a52fe0-d599-4346-8f2f-b8b8ec867180