Attaching particles to hand in viewmodel. Need help
5 replies, posted
I've tried doing this in my SWEP:
[CODE]
function SWEP:SecondThink()
if self.Owner:GetAmmoCount( "psi_psychpoints" ) >= 250 then
self.Owner:SetAmmo( 250, "psi_psychpoints" )
end
local fx = EffectData()
fx:SetEntity(self.Owner)
fx:SetOrigin(self.Owner:GetShootPos())
fx:SetNormal(self.Owner:GetAimVector())
fx:SetAttachment("10")
util.Effect( "MuzzleEffect" ,fx)
end
[/CODE]
Unfortunately I am pretty dumb, so it didnt work. I searched up here:
[URL="https://wiki.garrysmod.com/page/Entity/GetAttachments"]https://wiki.garrysmod.com/page/Entity/GetAttachments[/URL]
The Left Hand is attachment 10. It still wouldn't attach to my left hand though, so I am completely clueless.
Any help?
[IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/CEffectData/SetAttachment"]CEffectData:SetAttachment[/URL] takes a number:
[code]
fx:SetAttachment(10)
[/code]
[QUOTE=zoox;52250163][IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/CEffectData/SetAttachment"]CEffectData:SetAttachment[/URL] takes a number:
[code]
fx:SetAttachment(10)
[/code][/QUOTE]
its still not working. It's just floating in the player's head.
[QUOTE=ricesoda;52250184]its still not working. It's just floating in the player's head.[/QUOTE]
anyone willing to help?
You are trying to attach the particle effect onto the player itself, not onto its GetViewModel()
[QUOTE=Robotboy655;52253817]You are trying to attach the particle effect onto the player itself, not onto its GetViewModel()[/QUOTE]
how would i attach it to the left hand in the viewmodel? do i get it's boneposition or something?
Sorry, you need to Log In to post a reply to this thread.