• Freezes weapons on spawn
    12 replies, posted
Hello. I have a problem with [B]phys:EnableMotion(false)[/B] on weapons. When I spawning weapon, it should be freeze in air, but it freezes only on 1 second, then falls down. On entities that works fine. That's my code: [CODE]local phys = ent:GetPhysicsObject() if phys and phys:IsValid() then phys:EnableMotion(false) end[/CODE] Can anyone help me?
Nobody knows?
MAke sure you have CSS Installed. Only reason i can find that causes that.
Are you running physwake? [editline]9th May 2013[/editline] [url]http://wiki.garrysmod.com/page/PhysObj/Wake[/url]
[QUOTE=Pandaman09;40587114]Are you running physwake? [editline]9th May 2013[/editline] [url]http://wiki.garrysmod.com/page/PhysObj/Wake[/url][/QUOTE] I tried that and weapons fell down immediately.
No, if you DON'T call it, then the physics won't "start" (until bumped?) [editline]13th May 2013[/editline] [url]http://wiki.garrysmod.com/page/PhysObj/EnableMotion[/url] -- or you already tried that :P You could spam [url]http://wiki.garrysmod.com/page/PhysObj/Sleep[/url] ... but it's not a great idea You could also set the velocity to -velocity... that might work.
[QUOTE=Pandaman09;40633497]No, if you DON'T call it, then the physics won't "start" (until bumped?) [editline]13th May 2013[/editline] [url]http://wiki.garrysmod.com/page/PhysObj/EnableMotion[/url] -- or you already tried that :P You could spam [url]http://wiki.garrysmod.com/page/PhysObj/Sleep[/url] ... but it's not a great idea[/QUOTE] I have tried many things, but weapon always freezes on 2-3 seconds and falls down or just falls immediately. I created an entity with model of weapon which gives that weapon and removes. That's works fine, but it's not suitable for grenades on deathrun maps. Idk what to do :\
What are you trying to do? You might be able to use prop_static or something
[QUOTE=Pandaman09;40633694]You might be able to use prop_static or something[/QUOTE] How to do this in lua?
eh... [code] local button = ents.Create( "Prop_static" ) button:SetModel( "GUNMODEL" ) --model wanted button:SetPos( Vector( 0,0,100 ) ) --pos wanted button:Spawn() --spawns it [/code] [url]https://developer.valvesoftware.com/wiki/Prop_static[/url] "It cannot move, animate, or accept input..."
[QUOTE=Pandaman09;40634009]eh... [code] local button = ents.Create( "Prop_static" ) button:SetModel( "GUNMODEL" ) --model wanted button:SetPos( Vector( 0,0,100 ) ) --pos wanted button:Spawn() --spawns it [/code] [url]https://developer.valvesoftware.com/wiki/Prop_static[/url] "It cannot move, animate, or accept input..."[/QUOTE] That's not working in SWEP:Initialize
[QUOTE=TheMostUpset;40634099]That's not working in SWEP:Initialize[/QUOTE] So again what are you trying to do?
[QUOTE=Pandaman09;40634475]So again what are you trying to do?[/QUOTE] I tried to add that code in function SWEP:Initialize, but it's don't working and don't should working, because these strings are not for sweps
Sorry, you need to Log In to post a reply to this thread.