How to add gunskins to Lyra Starter game

i would like to know how to make a gunskins system for my lyra starter project… the system should include a ui and the system is going to use materials for skins NOT seperate models

i would like it to be similar if not exactly the same as fortnites weapon wrap system

Hey there @Deadshot1m24! Changing out the materials on the Lyra guns based on the player is easy as pie for singleplayer, not quite so simple for multiplayer however. Generally the idea would be to store the player’s skin information in a struct somewhere, for singleplayer I’d pop it in the game instance as it persists through levels. Then you’d be able to call from the Begin play in the weapons (which are called every time a player pulls them out) to change the weapon material to the one stored in the game instance.

But this is complicated by multiplayer in that you would want to get the reference from whatever authority tells the player what skins are unlocked and all that jazz.

Whichever mechanism you use to get the materials over, you’re going to likely apply it in the BP_Gun’s start play, but you’ll have to get that variable from either the player actor, their player state, or passing it in from the session or somewhere else.

Bonus hint: All of the materials need usage flags for SKMs
image

In short, the answer for this is kind of full tutorial worthy!

2 Likes

Thank you for your response… As i’m a vbeginner i have no idea what most of this means… Is there any chance a video tutorial out there? I understand things way more visually

-Deadshot1m24

Lyra is an amazing resource, but it’s a little dense for new developers. You’re learning to swim in a deep lake in this case, as because Lyra is set up for online multiplayer. This makes everything you do significantly harder.

That said, there’s not many resources directly for changing the materials on Lyra guns with information from elsewhere. This BP I showed off before will change the material, but you need to decide where you’re going to get that material. I can do a slightly longer write up and go into detail if you’d like, but it may take some time.

1 Like

Like i said before i’m more of a visual learner… I cant just look at some documentation or have someone explain it… Thats why ive been learning UE5 through tutorials and then once i know it i do it multiple times… Like i can transfer a third person camera to 1st person in the 3 seconds without flaw…
The reason im asking here is because i litterally cannot find a tutorial on this… The only video i found that was related was a showcase video showing the finished product

No worries, I’ll see if I put a little something together for you over this week.

A couple questions! Are you using the Lyra framework for full term multiplayer or are you building it for local play? Do you have any character select or any framework to choose things before a match in place already?

1 Like

Yes its going to be full multiplayer… And no i dont have any customization options in place at the moment

So as a forewarning, this isn’t going to handle all of the overarching stuff required to pass inputs in from a server or anything, this will show you how to just change the material for your character when you play for now. The reason for this is because it would take quite a ton of architecture above this for a “Full Game Skin System”, and that’s way out of scope. Should be done in a couple of days.

2 Likes

so… no other players will be able to see your gunskins? also will this be done for all guns or will you be able to change it for every gun ex. make AR red and SMG blue?
is thta how it works or is it going to be… Select color red… all guns become red… i would prefer individual guns if thats how the system works… since its going to be a simplified system that your providing me what features wont be in the system… (compared to fortnites system)

So the system I’m working together will replicate for all players, but the caveat is that you don’t have a system in place as of now for say character select, or skin selection. Something like fortnite takes that info from a server, and then sets your player information in a persistent way. The only persistence currently built in to Lyra’s systems is the networking side, which means either I’d have to set up a content delivery system or just show you how to get the skins working. There’s so many systems that interact with something like this that taking just a small sample of it (the applying the skin aspect) is still a pretty large system of itself.

I’ve created a system set for a client like that before, and there’s a TON that goes into them more than most players will recognize. The system I am iterating on for you to work with is going to be simple, player can choose a skin (while in game because there’s no external architecture built) and then everyone can see it. Any more would take exponential time, but you should be able to work from what I show you. Once you know what to do you’ll likely rewrite the whole thing!

1 Like

Thanks that is plenty enough for now… I plan on learning how to do a few more things like a shop and currency after this is done and then i’ll put it all together and write everything i need for my own complete complex skin system :slight_smile: thanks for the help

question… will the system your building potentially work as a skin system as well? or would that system have to be different… I’m just wondering… it would be nice to kill two birds with one stone

The system I’m dabbling with will be able to attach to an external skin system but by no means will it be. There’s a ton of infrastructure above it that needs to be done. It’s way out of the scope of tutorial there. This will just get you a variable that you can change to add skins in and have everyone see them. Past that is more than I’d be able to do without taking too much time away from others on the forum.

Hit a bit of a snag though since Lyra uses a custom system to do server calls. In raw UE I can tell the server that I want this changed and it will change it. However Lyra has some ownership rules (basically a simple anticheat) that doesn’t allow you to send calls to the server for other players. The system is done actually but I need to figure out how to properly pass the data in Lyra’s case. Otherwise it’s only visible locally.

1 Like

Thanks for making this blueprint for me

also do you have a yt channel? i want to know if your going to upload the tutorial to yt or just link a video file

thanks

I’ll upload a short video here and use the site BlueprintUE to show off the blueprints as it makes a copy/pastable way to show off the BP and you can see it in browser clearly.

2 Likes

is it still possible for me to access this?