[Tutorial] UsableActor system in Blueprint with multiplayer support

Remove the extra static mesh component in BP_PickupActor. Then go assign the book mesh to the root actor component in the Defaults tab of BP_PickupActor.

Hello Tom.

I am following through the tutorial, but mainly as a non multiply player game. Anyway, I have a problem. The GetUsableActor is always an event when I drag it to the event graph. Why is that so. I am struck currently here.

00f8e1a75c33721c6f5859e1c835e462126b0e8b.jpeg

Edit: Ok, solved. I realized by forgot to connect one white line in the getUsableActor function creation, so there is no output, & it automatic become event…

Once I connect the lines properly, its now a function in the event graph. Part 1 is working now.

Anyway, just a suggestion. Since this is a tutorial, it would be nice if there are more explanations on what some the connections do. That would have save a lot questions listed here & on your page. Also it would be nice to add comments to some nodes so its easier to follow. People can eventually get the nodes, but more detailed explanation will prevent less guessing.

What you have are often the end result (resulting blueprint connections), but very little explanation. Just something to think about in your next tutorials. Cheers

How to delete the original parent box? Deleet or remove option are not available.

Anyway here is what I have now.

Set a box as root and delete the mesh in details to have a “static mesh : none” then you’ll can set a new mesh for each child. I did like that for usable bp, activable actors and it works perfect. (this is the same method than character master in mixamo for example but it uses a capsule )

Thanks, it works!

Sorry, its me again. Haha
I hit another wall.

Is the ‘Start Focus Item’ & ‘End Focus Item’ in pickupActor class (part 2) renamed of the ‘Begin Focus’ & ‘End Focus’ (minus the ‘character’ variable input) of UsableActor?

I love this community!! We all rock and I love being a part of this!

Yes this is the same thing. One is a custom event and the other a function but you do the same. The only thing is to be sure that you always call the same one to not have troubles. (i used the function to have output infos but outputs are not needed in fact so it is the same ^^)

And it can be used for loot /activation or characters detection / event ike : [video]Instanced mesh random maze generator - Showcase - Epic Developer Community Forums
I just had to set “cast to” and variables.

Thanks Tom ^^

Thanks for helping him out guys! :slight_smile:

I have noted the points of confusion and I want to update all 3 tutorials in an upcoming site update. That should clear up a lot of issue people are having when following the tutorials.

Thanks Tom,

Unfortunately, turns out it doesn’t work, the parent child mesh thingy. Only way it can ‘somewhat worked’ is that I attached the original box as static mesh. It doesn’t make sense at all. I just cannot exchange the box with the book like others do. maybe Epic hate me…

Funny thing is, I thinked it worked, until the PC crushes. I said I think because I was working like a madman, & my memory is cloudly. I not sure I can sleep well tonight, its not the worst thing that can happened in life, but I am fairly sad.

Its a frustrating day & fairly sad use of a Sunday evening for me.

Maybe tomorrow evening, I will try again…

Everything else did work…Funny that the supposedly most simple step turns out the hardest.

**Edit 1:**This is the best I managed. Its not what I hope for for sure, But beats not working for sure. I actually add the book as a new mesh (which end up having 2 same meshes overlapping, which obviously bad), instead of exchange, as exchanging mesh under the default do not work for me.

13f13d9088bfea96d7b2cac2a8d100da0a5da493.jpeg

on top of this warning, which I do not know how to resolve, mainly due to I have no idea where the property window is located.
[Static Mesh Actor] : Static Mesh Actor has NULL StaticMesh property

This warning is caused when there is a Static Mesh Actor in a level with a NULL StaticMesh property. This can be a problem because the Actor exists and is using memory, but does not have a Atatic Mesh to actually draw. This warning is usually the result of creating a StaticMesh Actor without first selecting a StaticMesh in the generic browser. This warning can be fixed by first selecting a Static Mesh in the generic browser and then going to the StaticMesh Actor’s Property Window->StaticMeshActor Category->StaticMeshComponent->StaticMeshComponent Category to set the ‘StaticMesh’ Property.

**Edit 2: **
Hmmm, manage to make the child mesh work (irritating warning message of NULL StaticMesh property still there though). Just replacing with some random meshes as few times…Maybe some small bug in UE4.

Its a long day, I shall cobtinue tomorrow to refine the inventory, & hopefully resolve the error message, have a nice night everyone.

Hey Starseeker, don’t forgive ! You’re not far to success ^^

Create a blueprint with a box component ‘not a mesh !!!’ as root and an empty mesh added. Create the “begin focus” / “end focus” / “on used” functions in it. In your character, set your “cast to” to the new blueprint in your “get usable actor”. It would be ok.

Thanks, you have been most helpful. :slight_smile:

I will try later. So its a box component, not a box mesh, I see. Silly me.

Edit: I can’t get your suggestion to work. I do eventually found a solution (but the solution means I can’t get physics to work, its another thing for another day, as I am moving on).

Just to share, I went back & look at the blueprint content examples project ,under blueprint parent-child, the one with the heathbar as parent, & cupcake as child.

In the pickupblueprints, It used a Swapmesh function node inside contruction script. This allow the swapping of Static mesh at creation. I put this function in & input a staticMesh vaiable MeshToUse (to exchnage the original mesh), & it worked!

But because its a Static mesh, not static mesh compont, Physics is disable. Its not a big deal for my game, so I am satified with teh solution & movng on my next step in leanring UE4.

But thanks anyone, & Tom for the help & tutorial.

Oh, its me again, but no worries, I am just posting my ‘success’ story.

I manage to get the tracing & pick up down, & update to add a simple info beside the cursor on focus, typical of an Adventure game. Nothing fancy. I also replace the post effect selection outline with emissive shine (just a matter of preference really). The inventory is still work in process. I follow the inventory part 2 fine, but I think it need to evolve more for a proper game. It was a good exercise & start point though.

97e0e3a80390cd4b869b70744e0c72520c5636ad.jpeg

I want to thanks everyone, particularly Fen, & of course Tom for his tutorial. Its not always a smooth journey in my quest for UE4 proficiency, but I know I can rely on the very helpful community to get me to my destination. Hopefully in time, I can asisst newbies & make tutorials for other also, in time…

Tomorrow is a public holiday in Germany, so I will be taking a break from UE4, & I look forward to the next stuff to learn…:slight_smile:

Cool! Nice to see it worked out for you. And yeah the inventory system is only a starting point to show people one of the hundred ways you can tackle that type of complex system.

Loving the screenshot btw :slight_smile:

Have you applied the changes in my screenshots? Not sure why it wouldn’t work if you have, honestly.

It’s been a LOOONG time since I’ve looked at this, but from what I recall, it should work networked.

That said, looking over the thread there are a couple of posts I notice that might explain why it’s not working for you:

So make sure to pass the character along, so that you aren’t operating on the (non-existent on remote clients) player supplied by get player with index 0.

So it looks like you’ll need to add a RepNotify to do the attachment on remote clients. I’m not sure how that should be set up into the current system, but if you look into the RepNotify tutorials, it should give you some ideas.

The screenshots from earlier in the thread are really old - they may have changed how it displays.

That said I think the real issue is replicating the attach to remote clients (i.e., clients which are not the owning client), which I think you’ll need RepNotify for, and which wasn’t in the original tutorial or my example screenshots.

Sorry I can’t be more specific, I just don’t have this project or code handy at all to test, it’s been a long time.

Check out the tutorial there - set the variable you’re using to keep track of the pickup actor’s replication to RepNotify, then do Set w/ Notify as in the screenshot here: https://docs.unrealengine.com/latest/images/Resources/ContentExamples/Networking/1_4/1_4_EventGraph.png

Then, you’ll get a function called Variable_OnRepNotify, just set that function up to do the attachment and whatever after a switch has authority set to execute on the client pin.

Basically, you need to notify the remote clients that the attachment happened and do the attachment on each remote (non-owning) client.

At this point if you still have issues, package an example and I’ll see if I can make it work and identify the problem that way - I’m not good at helping with problems like this without the code at hand.

I’ll take a look this weekend and see what I can find out.

@JJGG117 - Passing the BP_UsableActor through to the server side OnUsed did the trick to pick them up for me.

Change the Use event so it looks like the below in the character’s event graph: