#crosshair

1 messages · Page 1 of 1 (latest)

warm peak
#

You can add a binding to the cursor_renderer element in the vanilla hud screen that hides it when the player is sneaking by passing a title, actionbar, etc.

sterile abyss
#

i dont know a lot about uis

#

only basics

#

a bit

warm peak
# sterile abyss pls teach me!!!

a basic setup would look like:

  "cursor_renderer": {
    "bindings": [
      {
        "binding_name": "#hud_title_text_string",
        "binding_name_override": "#text"
      },
      {
        "binding_type": "view",
        "source_property_name": "(not (#text = 'sneaking'))",
        "target_property_name": "#visible"
      }
    ]
  }

Then in the BP you can just send a title with "sneaking" when the player is shifting and clear it when they aren't. If you add more UI on top of this you'd probably want to set this up in a more dynamic way, but this is a simple way to do it.

sterile abyss
#

hud_screen.json?

warm peak
#

yes

sterile abyss
# warm peak yes

not work, also i tried deleted all the elements but why is it still visible?

#

wait it work a bit

#

@warm peaklike this?

warm peak
sterile abyss
#

can i test it with title command?

#

ok

warm peak
#

yeah they updated a lot of stuff just recently and the vanilla screen im using is probably outdated

sterile abyss
warm peak
#

oh yeah they did.. lemme rewrite the original code I sent you

sterile abyss
#

ok

#

pls

warm peak
# sterile abyss ok

Try this:

  // hide crosshair/cursor for given string
  "root_panel/curor_rend": {
    "bindings": [
      {
        "binding_name": "#on_new_death_screen"
      },
      {
        "binding_name": "#hud_title_text_string",
        "binding_name_override": "#text"
      },
      {
        "binding_type": "view",
        "source_property_name": "(not (#on_new_death_screen or #text = 'sneaking'))",
        "target_property_name": "#visible"
      }
    ]
  },
sterile abyss
#

root panel or cursor renderer element

warm peak
#

in hud_screen.json

#

you just put it in by itself

sterile abyss
#

ty

#

but

warm peak
#

nice :). np

#

you can just send a different title when player releases sneak

sterile abyss
warm peak
warm peak
sterile abyss
sterile abyss
#

wait

sterile abyss
#

AND IT WORKS

#

thank you

warm peak
#

glad you got it working 🙂