EvaisaDev/LethalCompanyUnityTemplate

Creating new scrap

Opened this issue · 5 comments

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 :)

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 😵‍💫

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

  • Network Object component
    -- Synchronize Transform, Scene Migration Synchronization, Spawn With Observers, Dont destroy with owner are true.
  • Physics Prop
    -- make sure Grabbable is set, Item Properties and Main Object Renderer. (Grabbable by enemies perhaps too)
  • Box Collider make it surround your object, this is the grab hitbox
  • Audio Source (for me atleast.. otherwise dropping the prop and swapping slots throws an error)

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)

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

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?

@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