How do I make a text appear when hit by an object and disappear when no object was hitting it?

I am making a Platforming game and make npcs like a man in the shop so I need text box that shows their messages

I suggest looking at other games for examples

Proximity → Number (100) → Label (Alpha)

to turn text off

Proximity —> NOR gate → Number (0) → Label (Alpha)

1 Like

I wish this could work with collision

1 Like

I mean you could have an object that turns the text on, then have a second object that turns it off when you hit it.

You could use collision any to turn it off

That would also work, just have to make sure it doesn’t turn off the text when you hit the object that is supposed to turn it on.

Could you give an image example? I’m trying this method but I’m not sure how you meant for it to be connected

I’m on Mobile right now, but I’ll get a screenshot for you when I’m on a computer :+1:

1 Like

Sorry my internet was out this morning and I just forget with class yesterday, I’ll get the screenshot rn


@ofarmerFBHS
Flowlab has updated a little bit, so I slightly modified what I said originally.

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":0,"name":"Display Message","behaviorType":"logic.NodeGroup","x":-270,"y":-16,"group":"88ba297f51870144","id":"6c97180edbe75c48","isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":-270,"y":656,"group":"6c97180edbe75c48","id":"6c93e1e7e04fd44a"},{"inputCount":0,"outputCount":2,"name":"In View","behaviorType":"logic.triggers.InView","x":-270,"y":576,"group":"6c97180edbe75c48","id":"6c93e611e6cb6943","buffer":0},{"inputCount":2,"outputCount":3,"name":"Proximity","behaviorType":"logic.components.Prox2","x":90,"y":576,"group":"6c97180edbe75c48","id":"6c93fc44601ce742","notes":"Seach for the Player","n_o":1,"targetEntityId":0,"threshold":32,"nearestOnly":false,"firstObject":true,"allObjects":false,"contains":false,"shape":0,"oX":0,"oY":0,"pin":false},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":-90,"y":576,"group":"6c97180edbe75c48","id":"6c9418496859d744","_startVal":0,"dataType":2},{"inputCount":5,"outputCount":2,"name":"Text","behaviorType":"logic.data.TextBlock","x":270,"y":752,"group":"6c97180edbe75c48","id":"6c946f034874d049","notes":"Remove Message","n_o":1,"startVal":""},{"inputCount":5,"outputCount":2,"name":"Text","behaviorType":"logic.data.TextBlock","x":270,"y":576,"group":"6c97180edbe75c48","id":"6c946f8403693c47","notes":"Display Message","n_o":1,"startVal":"Awesome message here!"},{"inputCount":4,"outputCount":4,"name":"Label","behaviorType":"logic.hud.Label2","x":450,"y":576,"group":"6c97180edbe75c48","id":"6c95177b4cf93d41","notes":"You probably want an \"Attached\" Label\n(There is a checkbox in this behavior called \"attach to object\")","n_o":1,"text":"Label","textColor":6929245,"fontName":"oduda","scale":10,"textAlign":"left","maxWidth":0,"xO":0,"yO":0,"pin":false,"alpha":100,"kerning":0}],"links":[{"input_id":"6c9418496859d744i2","output_id":"6c93e1e7e04fd44ao0"},{"input_id":"6c9418496859d744i1","output_id":"6c93e611e6cb6943o0"},{"input_id":"6c9418496859d744i0","output_id":"6c93e611e6cb6943o1"},{"input_id":"6c946f8403693c47i1","output_id":"6c93fc44601ce742o0"},{"input_id":"6c946f034874d049i1","output_id":"6c93fc44601ce742o2"},{"input_id":"6c93fc44601ce742i1","output_id":"6c9418496859d744o0"},{"input_id":"6c95177b4cf93d41i0","output_id":"6c946f034874d049o0"},{"input_id":"6c95177b4cf93d41i0","output_id":"6c946f8403693c47o0"}]}}}