Entity/SetSolidFlags

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Added a warning about the collision can get bugged on some entites... Idk why.)
(The issue is that vphysics collision hooks aren't called when an entity uses trigger bounds. RPG rockets rely on these hooks to explode the rocket, which obviously wont happen if the entity uses triggers.)
Line 3: Line 3:
  
 
This overrides any other flags the entity might have had. See {{ClassFunction|Entity|AddSolidFlags}} for adding flags.
 
This overrides any other flags the entity might have had. See {{ClassFunction|Entity|AddSolidFlags}} for adding flags.
 
{{Warning|When flag "FSOLID_TRIGGER" and "FSOLID_USE_TRIGGER_BOUNDS" are set, collision on some models get bugged; the entity will get stuck. Can be experienced with such as the RPG Rocket from the Half-Life 2 Rocket Launcher and the bugbait. [https://youtu.be/Gp0Ak-B74rY Scenario example]. Maybe some additional settings needs to be set...}}
 
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes

Revision as of 02:34, 6 May 2019

 Entity:SetSolidFlags( )

Contents

Description

Sets solid flag(s) for the entity.

This overrides any other flags the entity might have had. See Entity:AddSolidFlags for adding flags.

Arguments

number flags

The flag(s) to set, see FSOLID_ Enums.

Examples

Example

Set self as a trigger (the same as SetTrigger):

self:SetSolidFlags(bit.bor(FSOLID_TRIGGER, FSOLID_USE_TRIGGER_BOUNDS))


Personal tools
Navigation