• Drowning effect and making a phyobj not float
    5 replies, posted
I have 2 questions. 1. How can I set the type of damage to a drown effect. I already have the drowning mechanism in place, now I just want it to act like the player is actually downing. I looked into [url=http://wiki.garrysmod.com/?title=CTakeDamageInfo.SetDamageType] THIS [/URL] but I am unsure how to use it or if it is even the correct thing to use. Any ideas on how to accomplish this? 2. I have an exploding physobj which floats in the water. I want it to not float in the water. It'd be nice if it did move slower once in the water but it isn't necessary. I looked at [url=http://wiki.garrysmod.com/?title=PhysObj.SetBuoyancyRatio] THIS [/URL] but setting it to 0 or 1 (the logical choices) didn't do anything. Thanks
As for question two, what model are you using? That might have an effect on the buoyancy. Or I could be completely wrong. Try swapping the model?
Question 1, [LUA] local dmginfo = DamageInfo() dmginfo:SetDamage( 10 ) dmginfo:SetDamageType( DMG_DROWN ) dmginfo:SetAttacker( GetWorldEntity() ) ply:TakeDamageInfo( dmginfo ) [/LUA] Question 2, could look at the buoyancy tool. [url]http://www.garrysmod.org/downloads/?a=view&id=38465[/url]
@Morcam: "models/Items/AR2_Grenade.mdl" @-TB-: Thanks a ton -TB-, worked great. Just a little issue now with the kill icons but it should be an easy fix. I'll take a look at that tool also. The only problem is it might only make things buoyant. I'll see if it can remove buoyancy.
[QUOTE=S W;26705459] 2. I have an exploding physobj which floats in the water. I want it to not float in the water. It'd be nice if it did move slower once in the water but it isn't necessary. I looked at [url=http://wiki.garrysmod.com/?title=PhysObj.SetBuoyancyRatio] THIS [/URL] but setting it to 0 or 1 (the logical choices) didn't do anything. [/QUOTE] Read the question again. I already looked into that, as specified by the link, but setting to 0 or 1 didn't do anything.
Sorry, you need to Log In to post a reply to this thread.