Revision Difference
CLuaParticle:SetCollideCallback#513795
<function name="SetCollideCallback" parent="CLuaParticle" type="classfunc">⤶
<description>Sets the function that gets called whenever the particle collides with the world.</description>⤶
<realm>Client</realm>⤶
<args>⤶
<arg name="collideFunc" type="function">Collide callback, the arguments are:




<page>CLuaParticle</page> particle - The particle itself

<page>Vector</page> hitPos - Position of the collision

<page>Vector</page> hitNormal - Direction of the collision, perpendicular to the hit surface</arg>⤶
</args>⤶
</function>⤶
⤶
<example>⤶
<description>Creates an explosion every time an particle collides with something.</description>⤶
<code>⤶
MyParticle:SetCollideCallback( function( part, hitpos, hitnormal ) --This is an in-line function⤶
local efdata = EffectData() --Grab base EffectData table⤶
efdata:SetOrigin( hitpos ) --Sets the origin of it to the hitpos of the particle⤶
util.Effect( "Explosion", efdata ) --Create the effect⤶
end )⤶
</code>⤶
⤶
</example>