EvaisaDev / LethalCompanyUnityTemplate

Unity project template for Lethal Company modding
MIT License
61 stars 44 forks source link

Creating new scrap #1

Open faejr opened 9 months ago

faejr commented 9 months ago

I'm trying to create a new scrap using your template and lethallib, but I keep getting stuck on the referenced MonoBehaviour not being found. I know in Unity you can't include scripts in the AssetBundle but I can also see that they're included in the lethalthings assetbundle, am i missing some step to make it possible?

edit: I completely forgot about the assembly definition, my fault :)

faejr commented 9 months ago

Actually I've spent far too long trying to create scrap, is there any chance you could include an example scrap in this template?

Edit: So seems I've managed to make the scrap spawn, but for some reason I can't grab it, but scanning works 😵‍💫

Adesii commented 9 months ago

does the prop have a box collider? There is a bit that has to be manually set and setup for custom scrap to fully work but... here is a small rundown from my own experience.

here is how my scrap is setup:

Root GameObject of the Prefab should have: Tag: PhysicsProp, Layer: Props

if you want to look at it yourself: fumo_scrap.zip

here is a unitypackage with my fumo scrap, just import it into the template project and look at the fumo prefab

(note: i couldn't test it in multiplayer with friends yet so the network settings might be wrong. but solo it works totally fine. so i don't really have doubts it doesn't work in multiplayer)

faejr commented 9 months ago

I've already managed to make working scraps a while after i posted this, but thank you :) the thing that took I actually struggled with was setting the proper tags/layers because it wasn't too obvious from the start

rheaSaturn commented 9 months ago

hey @Adesii , I'm using your fumo_scrap package as reference for an item I wanna add, I need help compiling the package into a .dll. Can someone guide me on how to do it, please?

Adesii commented 9 months ago

@rheaSaturn https://github.com/Badhamknibbs/Cirno-Fumo-Scrap-mod_LC I basically just copied this and changed the names of the files and file paths.

You open this in visual studio and compile it after changing all the stuff. Then go into the path it compiled to and you got the DLL. Then you copy the DLL to your plugin folder and put the asset bundle next to it