Jump to content

Recommended Posts

Float:

You probably have "MakeInventoryPhysics(inst)" somewhere in your item's code, right? Just add this below it:

MakeInventoryFloatable(inst, "small", 0, 1)

It doesn't have to be right after it, it's just generally a good spot. The most important thing is that it's before "inst.entity:SetPristine()" or "if not TheWorld.ismastersim then return inst end", because code before those means it exists on the client too, which is what we want.

For the parameters, first one has to be inst (your entity), then we have:

  • The size of the floating animation, options are "small", "med" and "large"
  • The offset of this animation, higher number means it moves higher, try going in small increments like 0.1 or 0.2 to test
  • The scale of this animation, 1 means default scale but you can go higher or lower depending on your needs. It can even be a table if you want to adjust x,y,z independently
  • There's more parameters, like being able to play a different animation when on water, but for most items you won't need them so I'll keep it simple

Sink:

After your typical "inst:AddComponent("inventoryitem")", add this line below it:

inst.components.inventoryitem:SetSinks(true)

 

That's it! Hope this helped.

Edited by ClumsyPenny
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...