Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
NotAChaosSpy

Hud Messages to disappear after passing a line?

Recommended Posts

I want to make a note/letter the player can read, and for it to disappear when they walk away from it. How can this be done, because I've tried a few things, but no luck.

Share this post


Link to post

Make sure your Message has an id, and set it's Hold time 0, and when you want to hide that message use another Hudmessage with the same id but with a different Hold time.

HudMessage(s:"Hello there"; HUDMSG_PLAIN, 1555, CR_RED, 0.1, 0.9, 0); //a Message with id 1555 and Hold time 0 causes the message to stay forever



HudMessage(s:" "; HUDMSG_PLAIN, 1555, CR_RED, 0.1, 0.9, 0.1); //a empty Message with id 1555 and Hold time 0.1 replaces the text using the same id with an empty message that disappears after 0.1 seconds.

 

 

Share this post


Link to post
Posted (edited)
14 minutes ago, dmg_64 said:

Make sure your Message has an id, and set it's Hold time 0, and when you want to hide that message use another Hudmessage with the same id but with a different Hold time.


HudMessage(s:"Hello there"; HUDMSG_PLAIN, 1555, CR_RED, 0.1, 0.9, 0); //a Message with id 1555 and Hold time 0 causes the message to stay forever



HudMessage(s:" "; HUDMSG_PLAIN, 1555, CR_RED, 0.1, 0.9, 0.1); //a empty Message with id 1555 and Hold time 0.1 replaces the text using the same id with an empty message that disappears after 0.1 seconds.

It worked, thanks for that!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×