JaccK1618 Posted September 28, 2024 Share Posted September 28, 2024 It currently just kind of sits on the water. What are the tags and how do I implement them into the code? Link to comment https://forums.kleientertainment.com/forums/topic/159987-how-to-make-item-sink-or-float/ Share on other sites More sharing options...
ClumsyPenny Posted September 28, 2024 Share Posted September 28, 2024 (edited) 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 September 28, 2024 by ClumsyPenny 1 Link to comment https://forums.kleientertainment.com/forums/topic/159987-how-to-make-item-sink-or-float/#findComment-1751087 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now