Hi
I’m sure this is silly question but really i tried to make player able to read note or let’s say memo not text draw i need draw image to show it in screen while in gameplay, but i can’t figure out how to do it
can anyone please guide me step by step how to make it.
for example when he reach to actor: note press R for example to read it and pick up.
Thanks
You mean the actual writing, or do you mean the act of picking up the note, and having it move up to the camera so the player can read it?
You can either animate the note up to the camera or you can physically move it through space and have it rotate up to the player view.
Hi Zeustiak
No i didn’t mean that , i mean pick up note and the show in screen here in example
&stc=1
i want step by step how to do it in blueprint
All you need to do is create an image file with the note you want to display, and conditionally draw it in your HUD blueprint.
EDIT: Step-by-step instructions
1: Make your texture with the note to display on it.
2: Create or edit your Gamestate blueprint. Not the Gamemode, Gamestate. Add a Texture2D variable, and a Boolean variable. Make them both public. You will use these to tell your HUD what image to display, and whether to display it or not. Name them something appropriate.
3: Create or edit your HUD blueprint. Assuming you created a new one, add the Event Receive Draw HUD event. (Doing this all from memory, probably called something different)
4: Drag a wire off the Event Draw HUD. Create a Branch node and then drag a Draw Texture node off the True pin of the Branch node.
5: Create a Get GameState node below the the branch node. Drag a Cast to (Your Gamestate created in step 2) node off the Get Gamestate. Hook up the Cast node between the Draw HUD node and the Branch node.
6: Drag off the As (Your Gamestate in step 2) pin of the Cast node. Create a Get (Your Boolean of step 2) node. Hook that up to the boolean input of the Branch node.
7: Repeat for the Texture2D variable in your Gamestate, hooking it up to the Texture pin on the Draw Texture node.
8: Take the Texture2D node and get it’s width and height, hook those up to the width and height nodes on the Draw Texture node.
9: Divide the Screen X and Y and the texture’s Width and Height by two, then take the divided screen dimensions and subtract the divided texture width and height from them. Hook those up to the respective screen positions on the Draw Texture node.
You will need to set both of those variables during the game, and preferably check if the Texture2D variable is valid before drawing the note, but I think you can find plenty of examples of how to do that elsewhere on the forums and answerhub.
Pretty much this. You can check out the BlueprintHUD content examples for how to draw image and text on the HUD. We could give you a step by step, but there’s a lot more value in learning on your own!
Dear Axtel thanks for you help i did what you explain to me, but I’m stuck In step 6 as you said ( Create a Get (Your Boolean of step 2) node ) do you mean create variable Boolean and name it as what i name it in gamestate?
Can you show me if you don’t mind screen shot , i hope that to make me understand a lot .
Here what i did :
**Screen 1 : Create gamestate blueprint
**
**Screen 2 : Create Hud BluePrint for note
**
**Is this correct ?
thanks,**
Can anyone help how to make it , cause until now i tried i got error from step 6
You need to make a “get” function in your Gamestate blueprint, which will return the boolean in question.
Go into your Gamestate BP, make a new function, call it whatever you want, but “get <name of boolean>” is usually a good idea. In the details of this function, add an “output” to it. Then in the function’s graph, you simply hook your boolean variable up to the return node.
Once you have done this, you will be able to call the “get <boolean>” function from the other blueprint.
Dude you gotta make get functions, public variables is a nono
Thanks i will try what you did after i return to my room and i will check it
Can you explain more , he create as variable boolean , should we create as function ?
after i done this step , i will go next process how to save it in inventory , and opened for example files and select note again to let read again:D
I was being funny, I guess it doesn’t really matter. Normally when programming, you’d have get and set functions, rather than public variables that any part of the program can just reach into and modify as they see fit. For the purpose of ue4 blueprints, I don’t think you should worry too much about that.
I was being funny, I guess it doesn’t really matter. Normally when programming, you’d have get and set functions, rather than public variables that any part of the program can just reach into and modify as they see fit. For the purpose of ue4 blueprints, I don’t think you should worry too much about that.
If you think about it, the get/set functions you are talking about already exist in BPs as the default get/set. Also, in the gamestate image I forgot to make the variables public. You will want to make those public.
Hey I’m doing something similar to this. Followed all the steps above for the HUD and gamestate, but now I’m trying to figure out where/how to hook this all up to in the scene editor for use on specific trigger? Any advice?
Ok i make all the steps, but now i dont have idea to insert it in game.
I know this topic is of 2014, but i need id.
Thx