do you keep working on that inventory system? would be nice if you could upload pictures of the blueprints because you are to fast in the videos and you dont explain enough. after 2 attempts it still buggs around. does anybody got it actualy working? if yes i may give it a third try then.
I started running through this tutorial and got into a similar dilemma with the top down template. Im not getting anything to display on the screen except the crosshair. Im right at the end of the 4th video when were setting up the hotbars. Im a bit lost and not sure really where I went a stray. Any Help would be appreciated.
Ok just solved my own problem I had a derp moment.
I forgot to connect these in scale to ratio. I discovered this after seeing a small dot in the top left corner of the screen.
Hey everyone, im new to all this visual scripting. and i have been following these awesome tutorials for an inventory and item system to try and put my dreams together lol
i get to part 7 like everyone else, and now my hot bars don’t work at all. my inventory hit boxes work flawlessly. but im too much of a noob to figure out where i should be looking and what to pull apart. but i did figure out that if i change the array in the character BP to 55 instead of 50 that i get my hot bar… but it is in reverse and a bigger scale. idk if im beating a dead horse… sorry for my poor grammar, they kicked me out of english class
Does the inventory system (hit boxes) consume input events so scene objects directly behind the HUD elements aren’t accidentally selected with LMB clicks?
I had a test setup with an object that moves up by 10 units whenever it is clicked in the scene.
However, when the inventory is on screen and a square is clicked the mouse event is not consumed
and the scene object behind still receives interaction.
Does this happen to anyone else?
All I want to do is consume the inventory LMB clicks so they go no further.
I don’t want to do it by ray-tracing into the scene to see if anything is hit and temporarily disabling those objects. That’s a bit too clunky for me.
Okay so I’ve finished this tutorial and trying to fix/add in whats left over.
Problems I’ve fixed:
- hit box’s overlapping/ not being aligned with texture (I use scale to ratio function from earlier in the tut as I want better support for lower resolutions)
- Errors being generated when attempting to pickup/drag a non inventory item aka clicking on empty inventory slots
Problems to go:
- drop item from inventory
- fix switching of items from inventory slot 0 as doesn’t work
- stop item from disappearing when dragging onto non hitbox (sometimes item texture is left attached to mouse until clicking on a hitbox)
First fix, stop trying to pickup non-existent items:
Alrighty turns out switching of items from inventory slot 0 + other drag and drop issues within the inventory were caused by my stuff up. Have switched hitboxhighlighted to be set when Event Receive HitBox Release is fired
hey guys, does anyone have the texture files from part 6 of the youtube tutorials they could upload? the textures linked in the video are no longer being hosted
Help me help you…
So I know I’m not the only one trying to figure out a solution to problems, but I have some solutions, and some questions. I may be doing things wrong, I’m not a blueprint pro (yet XD) Help me if you have found a better way.
What I have implemented/fixed:
-Dropping item outside inventory puts item back into world
-Hotbar items displayed even after exiting inventory
-Can only pick up valid items (not the world)
-Fixed bug where putting an item back in the original inventory slot deletes item
What I need help with:
-Networking? Cant get the second player to pick up anything… (plz help)
OK I will start with only picking up valid items
1.) go to your “server attempt hit trace” function in your character blueprint (You will have needed to use 's naming convention…)
2.) drag off the object hit actor node in check if actor gets hit by trace and type “get class”
3.) drag off the resultant class and type “class is child of”
4.)With the resultant “class is child of” click the parent drop down and choose “BP_BaseItemPlaceholder”
5.)drag off the return value boolean node and type “branch”
6.)Connect the output exec from is valid to the input of the branch
7.) Connect the true exec from the branch to “Send destroy to item from local”
It Should look something like this…
Now For Hotbar items displayed even after exiting inventory
1.)Create a new function called “Draw Hotbar Inventory” in BP_HUD
2.)Go to the event graph and locate the branch where the true leads directly to draw inventory
3.)pull off the false exec node and type “Draw Hotbar Inventory”
it should look like this…
4.)Now open your “Draw Inventory” function, and copy everything
5.)open your “Draw Hotbar Inventory” and paste it all in
6.)Delete the Draw texture simple at the start, so it doesnt draw your inventory background, and attach the exec node on “Draw Hotbar Inventory” to “Cast to 'Insert Your Character Blueprint Name '”
should look like this…
7.)Now locate the two branches (with the current inventory > 50 condition) where the true nodes go up to the drawing hotbar inventory, and the false nodes go down to the draw regular inventory
8.) follow the false nodes and delete EVERYTHING to do with them
should look like this…
9.) Now follow the true nodes up and locate the “add hit box” and "add"and “make vector 2d”, and delete all of these
10.)connect both the true nodes from the two branches (with the current inventory > 50 condition) to the is valid up top
should look like this…
That should make it where your hotbar inventory is always displayed
Now for fixing the Putting an item back in the original inventory slot deletes item
1.)go to the switch item in inventory function in your character blueprint
2.)locate the branch, and copy everything after it
3.)Paste it in above the branch, and connect the true node on the branch to the cast to BP_HUD that you just pasted in
4.)Connect all three of the light green index nodes in what you pasted to the Button Pressed Node on the “Switch Item in Inventory” at the start
5.)Thats It! Finished Should look like this…
Now for making the items drop into the world!
1.)Make a Function called “Add Hit Boxes Outside Inventory” in BP_HUD
2.)go to the event graph and just after “texture update via pickup” drag off the exec node and type in “Add Hit Boxes Outside Inventory”
it will look like this…
3.)Now open your “Add Hit Boxes Outside Inventory”
4.) Drag off the “Add Hit Boxes Outside Inventory” exec node and do create hitbox
5.)Drag off the size node and do get screen dimensions
6.)Now set the name to “-1” and the priority to “-1” VERY IMPORTANT
should look like this…
7.)Now, go to your draw inventory function
8.) There are 2 add hitbox nodes called, find these, and change priority to 1 AND TICK THE CONSUMES INPUT CHECKBOX TO TRUE!!! verrrrry important

they should look like this…
9.)Now go to your character blueprint
10.)Create a function called “Drop Item Back Into World”
11.) go into your switch item in inventory function
12.)drag off the switch item in inventory exec node and type branch
13.)connect the false of the NEWLY CREATED BRANCH to the exec node of THE EXISTING BRANCH
14.)drag off the true node of the NEWLY CREATED BRANCH and type “Drop Item Back Into World”
15.)Now, drag off the button highlighted node of switch item in inventory, and type < (less than), and choose the “integer < integer” option
16.) make sure the second option on the less than is equal to zero
17.) Drag the red boolean off the less than and connect it to the condition on the newly created branch.
it should all look like this…
18.)Now, open your drop item back into world function
19.)drag off the exec and type cast to BP_HUD
20.)drag off the object on the cast to BP_Hud and type get HUD
21.)drag off thhe target node of your get HUD and type get player controller
22.)Now drag off the as BP_HUD node of the cast to BP_HUD and type get item being moved
23.)drag off the item being moved and type get Assigned texture for HUD
If all is going well it should look like this…
24.)now drag off the assigned texture for HUD and type get display name
25.)drag off the get display name and type to name (just converting string to name)
26.)Now drag off the name and type switch on name
27.)Connect the exec from cast to bp_hud to the exec on switch on name
28.)Now click the switch on name, and untick the “has default pin” checkbox, and add pins based on the names of your textures (VERY IMPORTANT). Whatever the name of the texture is that is displayed in the inventory is what needs to go . In my case, the textures were named “Battleaxe” and “Sword”, So I added two pins labeled like this. Mine looks like this…
29.) With that done, we have to get some info on how to spawn the object. Under the switch on name, type get player character
30.)drag off this and type get actor transform, and drag off of it again and type get base aim rotation
31.)drag off the get base aim rotation and type make transform
32.)drag off the get base aim rotation again and type break rot into axes
33.)drag off the Z node of break rot into axes and type break vector 2d
34.)drag off the x component of break vector 2d and type multiply and select float by float, and set the number multiplied by to 500
35.)drag off the y component of break vector 2d and type multiply and select float by float, and set the number multiplied by to 500
36.)I know this sucks guys, bear with me :S
37.)drag off the X multiply float by float, and type add and select float by float
38.)drag off the Y multiply float by float, and type add and select float by float
39.)Now, go back to the get actor transform from step 30, and drag off the location node and type break vector
40.)Now, drag the x component off the break vector and plop it in the add float with float from step 37.)
41.)Now, drag the y component off the break vector and plop it in the add float with float from step 38.)
42.)Now drag the z component off the break vector and type make vector
43.)drag the off the x float+float from step 40.) and plop it in the x of the make vector
44.)drag the off the y float+float from step 41.) and plop it in the y of the make vector
45.)Now drag the vector off the make vector and stick it in the location node of the make transform made way back in step 31.)
Now, if you made it through that wall of **** it should look like this…
46.)The worst is behind us… Now go to the switch on name and drag off the battleaxe (or whatever your texture is called), and type spawn actor from class
47.)Set the spawn actor class node to the corresponding blueprint, in my case BP_Battleaxe. Tells it that when the picture is a battleaxe, spawn a battleaxe
48.)connect the spawn transform node to the return value node of the make transform from step 45.)
49.)Connect the instigator node of the spawn actor to the get player character from step 29.)
50.)on the spawn actor Check the tickbox called spawn even if colliding to true
51.)This is optional, but cool (and easy). drag off the return value of spawn actor and type set simulate physics. This will cause the object to fall to the ground…
52.)Now repeat steps 46.) through 51.) for as many different objects you want to drop, as you will be able to see with my sword in the example.
Finished Drop item into world function will look something like this…
And the pain in the butt spawn part will look like this…
And heres a more detailed view of the actor spawns…
And that should do it! Now if you drag an item and drop it outside the inventory or hot bars, it will drop to the ground, and you can pick it up again!
(POSSIBLY) HELPFUL TIP! If you are testing hitboxes in game (especially when you are figuring out dimensions) push the tilde key ~ and type in “showdebug hitbox” without the quotes. This will show you all the current hitboxes outlined in white, and the outline will change to red when they are higlighted
Well thats all for now, I sure hope this helped a few people, please feel free to correct me where I’m wrong, andd share this or modify as needed. Huge thank you to Kun for his original set of awesome (possibly even epic) tutorials
Also, if anyone has encountered the network not replicating bug, please lend me a hand!
Thanks!
Addude14
Fix for picking up items affecting Terrain/Landscapes and regular static meshes:
The easiest way I sought to do this was adding a variable in BaseItemPlaceholder (IsPickable - Bool) As default set this to true (Else you will have to set it to true on every item you make based off the BaseItemPlaceholder)
After this Boolean has been created, open up MyCharacter blueprint and open the “Server Attempt Hit Trace” function. In we need to check the Boolean to decide whether to proceed with the Destroy Actor functions and so on.
I added this between :
[Switch Has Authority>CheckActorHitbyTrace] and the [branch that checks the “Trace hit” condition]
After Check Actor Hit By Trace, Execute a “Cast To BaseItemPlaceHolder” " - As Base Item Placeholder call the IsPickable Boolean , connect to the existing branch that checks TraceHit condition.
Break the link between this branch and the TraceHit Boolean, and create an AND Boolean off the branch.
Plug in both the IsPickable, and the TraceHit.
Also make sure to connect the ObjectHitActor from Check Actor Hit By Trace, into the object input in the Cast To BaseItemPlaceholder.
Compile and save; Now your regular static meshes and/or terrain landscapes should be safe, and you will only be able to pick up any item created based on the BaseItemBlueprint (as long as IsPickable is true in any instance of this class)
[hr]
*
Does anybody know a less clunky way to drop items back into the world? I imagine Addude14’s solution being tedious and inefficient when it comes to hundreds of pickable items…
Thanks in advance, I’ll mull it over too but I’m new to UE4 so no promises… *
I want to try this out but not sure is this tutorial works for UE4.8?
Workz
I recently swapped mine to 4.8
Everything has been working, I’ve tweaked some things but so far so good.
One thing that broke on switching from 4.7 to 4.8 was my equipping blueprint. I made a blueprint to equip things from inventory to hand, but 4.8 made it where it spawns at the players root, not at the hand, and I can’t find a fix (as yet).
I am sorry my way is clunky, I know it needs work, but I hope to figure something out (with some help).
I need to learn more about proper usage of arrays…
Unfortunately I work full time so this is kind of squeezed in among other things
Well I messed around with arrays a bit, and I found a much, much less clunky way to do this. You can add new objects by just editing two arrays default values!
So to do this you are gonna change the section in drop item back into world that looks like this
1.) Add a STRING array called Name to Int for Object and add a CLASS ACTOR array called Object List
2.)Do a get on the name to int for object array and drag off of it and do find item
3.)drag off the Assigned texture for HUD and stick it in the regular string node (not array node) of the find item and it will convert from texture automatically
4.)do a get on the Object List array, and drag of it and do a get (array version)
5.) drag the integer from the find item from 2.) and plug it in the new get
It should look like this so far…
6.) Now, Delete all but one of the spawn actors (Leave all the spawn placement **** though), and drag the get output into the class input for the spawn actor
It should look like this…
And Full view of the blueprint with spawn placement stuff…
7.) Now, you have to tell it what you have. In the name to int for object array, add default values for your Objects. THE NAME MUST BE THE SAME AS THE INVENTORY TEXTURE NAME FOR THE OBJECT! In my case, array number 0 is set to Battleaxe, because the inventory texture of my battleaxe is just called Battleaxe. The same with my sword. The array number from now on will be the unique identifier for that object (Referred to Object ID from now on).
Like this…
8.)Now In the Object List array, set the values of array entries (Object ID’s) To spawn the correct corresponding object blueprints. Like my Battleaxe’s Object ID I set to 0, so for the 0 entry in my Object List array I choose BP_Battleaxe.
Like this…
Now if you want to add more objects, you just add more entries in those two arrays
Hope this helps people, shoot me a question if you want explanations or if you have found a network fix
So I found the root cause of my network issues, please help me if you know how to fix
I am having trouble where my cast to bp base item placeholder is failing every time for client. It works for server, just not for client
I have my character blueprint and my bp base item placeholder blueprint set to replicate like they should, but still no go.
Thanks in advance!
Lol found an answer to my own problem, just a malevolent line trace
On a second note, now that I got that working, I realized I need to come up with a way to replicate my way of dropping items back into the world and equipping items to the server. Right now if I drop an item, it shows up only for the client that dropped it.
I will try to fix this, but replication is not my forte…
So, Found out replications actually not all that bad…
I have the Drop System and my weapon equip system all networked and working as they should
I Will gladly share, but Im not going to until someone requests it, because it will take a lot of time to explain
I am starting to work on a health/stamina bar system and a main menu too, so I am a little pressed for time.
If I get enough requests and doesn’t mind, I might consider making a couple videos to finish what he started.