Entity:EnableCustomCollisions
Entity:EnableCustomCollisions()
Açıklama
Bir varlığı, özel Lua tanımlı çarpışmaları kullanıyor olarak işaretler. Bu, Entity:PhysicsFromMesh sonrası gibi, varlıkların süngerimsi oyuncu çarpışmalarına sahip olması veya ışın testlerinin (trace) isabet etmemesi gibi sorunları düzeltir.
Dahili olarak Entity:AddSolidFlags( bit.bor( FSOLID_CUSTOMRAYTEST, FSOLID_CUSTOMBOXTEST ) ) ile aynıdır.
Bu fonksiyonu Entity:SetCustomCollisionCheck ile karıştırmayın, ikisi aynı şey değildir.
Örnek
Bir mesh tablosu oluşturur ve bunu varlığın çarpışmaları olarak atar.
function ENT:ProceduralPlatform()
local VERTICES = {}
for x = 1, 32 do
for y = 1, 32 do
table.insert( VERTICES, { pos = ( self:GetPos() + Vector( 0, 0, 1 ) ) } )
table.insert( VERTICES, { pos = ( self:GetPos() + Vector( 0, y, 1 ) ) } )
table.insert( VERTICES, { pos = ( self:GetPos() + Vector( x, y, 1 ) ) } )
table.insert( VERTICES, { pos = ( self:GetPos() + Vector( 0, 0, 1 ) ) } )
table.insert( VERTICES, { pos = ( self:GetPos() + Vector( x, y, 1 ) ) } )
table.insert( VERTICES, { pos = ( self:GetPos() + Vector( x, 0, 1 ) ) } )
end
end
self:PhysicsFromMesh( VERTICES )
self:GetPhysicsObject():EnableMotion( false )
self:EnableCustomCollisions()
end
Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord