# constraint

- **İngilizce aslı:** https://wiki.facepunch.com/gmod/constraint
- **Çeviri tarihi:** 2025-09-08

Kısıtlama (constraint) kütüphanesi, fizik motoruna entegre edilmiş kısıtlama sistemini (ip, kaynak, bilyeli mafsal vb.) kontrol etmenizi sağlar.

## Metotlar

constraint.[AddConstraintTable](https://gmod.tr/wiki/constraint.AddConstraintTable)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) constrt, [Entity](https://gmod.tr/wiki/Entity) ent2 = nil, [Entity](https://gmod.tr/wiki/Entity) ent3 = nil, [Entity](https://gmod.tr/wiki/Entity) ent4 = nil )

Bu, dahili olarak kullanılır - kullanabilmenize rağmen muhtemelen kullanmamalısınız. Bir varlığın tablosunda kısıtlamalar hakkında bilgi depolar.

constraint.[AddConstraintTableNoDelete](https://gmod.tr/wiki/constraint.AddConstraintTableNoDelete)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) constrt, [Entity](https://gmod.tr/wiki/Entity) ent2 = nil, [Entity](https://gmod.tr/wiki/Entity) ent3 = nil, [Entity](https://gmod.tr/wiki/Entity) ent4 = nil )

Bu, dahili olarak kullanılır - kullanabilmenize rağmen muhtemelen kullanmamalısınız. Varlığın tablosunda kısıtlamalar hakkında bilgi depolar. Bununla constraint.AddConstraintTable arasındaki tek fark, varlık kaldırıldığında kısıtlamanın silinmemesidir.

[Entity](https://gmod.tr/wiki/Entity) constraint.[AdvBallsocket](https://gmod.tr/wiki/constraint.AdvBallsocket)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2 = nil, [number](https://gmod.tr/wiki/number) forceLimit = 0, [number](https://gmod.tr/wiki/number) torqueLimit = 0, [number](https://gmod.tr/wiki/number) xMin, [number](https://gmod.tr/wiki/number) yMin, [number](https://gmod.tr/wiki/number) zMin, [number](https://gmod.tr/wiki/number) xMax, [number](https://gmod.tr/wiki/number) yMax, [number](https://gmod.tr/wiki/number) zMax, [number](https://gmod.tr/wiki/number) xFric = 0, [number](https://gmod.tr/wiki/number) yFric = 0, [number](https://gmod.tr/wiki/number) zFric = 0, [number](https://gmod.tr/wiki/number) onlyRotation = 0, [number](https://gmod.tr/wiki/number) noCollide = 0 )

Gelişmiş bir bilyeli mafsal (ragdoll) kısıtlaması oluşturur. Daha basit versiyonu için constraint.Ballsocket'a bakın.

[Entity](https://gmod.tr/wiki/Entity) constraint.[Axis](https://gmod.tr/wiki/constraint.Axis)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) forceLimit = 0, [number](https://gmod.tr/wiki/number) torqueLimit = 0, [number](https://gmod.tr/wiki/number) friction = 0, [number](https://gmod.tr/wiki/number) noCollide = 0, [Vector](https://gmod.tr/wiki/Vector) localAxis = nil, [boolean](https://gmod.tr/wiki/boolean) dontAddTable = false )

Bir eksen kısıtlaması oluşturur.

[Entity](https://gmod.tr/wiki/Entity) constraint.[Ballsocket](https://gmod.tr/wiki/constraint.Ballsocket)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos, [number](https://gmod.tr/wiki/number) forcelimit = 0, [number](https://gmod.tr/wiki/number) torquelimit = 0, [number](https://gmod.tr/wiki/number) nocollide = 0 )

Bir bilyeli mafsal eklemi oluşturur. Dönme açılarını da bir şekilde sınırlamak isterseniz constraint.AdvBallsocket'a bakın.

[boolean](https://gmod.tr/wiki/boolean) constraint.[CanConstrain](https://gmod.tr/wiki/constraint.CanConstrain)( [Entity](https://gmod.tr/wiki/Entity) ent, [number](https://gmod.tr/wiki/number) bone )

Belirtilen varlığın ve kemiğin geçerli olduğundan emin olmak için temel kontroller yapar. Varlığı kısıtlamamamız gerekiyorsa false döndürür.

[Entity](https://gmod.tr/wiki/Entity) constraint.[CreateKeyframeRope](https://gmod.tr/wiki/constraint.CreateKeyframeRope)( [Vector](https://gmod.tr/wiki/Vector) pos, [number](https://gmod.tr/wiki/number) width, [string](https://gmod.tr/wiki/string) material = nil, [Entity](https://gmod.tr/wiki/Entity) constraint = nil, [Entity](https://gmod.tr/wiki/Entity) ent1, [Vector](https://gmod.tr/wiki/Vector) localPos1, [number](https://gmod.tr/wiki/number) bone1, [Entity](https://gmod.tr/wiki/Entity) ent2, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) bone2, [table](https://gmod.tr/wiki/table) keyValues = nil )

Herhangi bir kısıtlama olmadan bir ip oluşturur.

[Entity](https://gmod.tr/wiki/Entity), [PhysObj](https://gmod.tr/wiki/PhysObj), [number](https://gmod.tr/wiki/number), [Vector](https://gmod.tr/wiki/Vector) constraint.[CreateStaticAnchorPoint](https://gmod.tr/wiki/constraint.CreateStaticAnchorPoint)( [Vector](https://gmod.tr/wiki/Vector) pos )

Dünyada, nesnelerin bağlanabileceği görünmez, hareket etmeyen bir çapa noktası oluşturur. Bu fonksiyon tarafından dahili olarak kullanılan varlık (gmod_anchor) yalnızca Sandbox türevi oyun modlarında mevcuttur, bu da bu fonksiyonun yalnızca bu oyun modlarında çalışacağı anlamına gelir. Bunu diğer oyun modlarında kullanmak için kendi gmod_anchor varlığınızı oluşturmanız gerekebilir.

[Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity) constraint.[Elastic](https://gmod.tr/wiki/constraint.Elastic)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) constant, [number](https://gmod.tr/wiki/number) damping, [number](https://gmod.tr/wiki/number) relDamping, [string](https://gmod.tr/wiki/string) material = "", [number](https://gmod.tr/wiki/number) width, [boolean](https://gmod.tr/wiki/boolean) stretchOnly = false, [table](https://gmod.tr/wiki/table) color = color_white )

Elastik bir ip kısıtlaması oluşturur.

[Entity](https://gmod.tr/wiki/Entity) constraint.[Find](https://gmod.tr/wiki/constraint.Find)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [string](https://gmod.tr/wiki/string) type, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2 )

Mevcutsa, iki varlık arasındaki belirtilen türde bir kısıtlamayı döndürür.

[table](https://gmod.tr/wiki/table) constraint.[FindConstraint](https://gmod.tr/wiki/constraint.FindConstraint)( [Entity](https://gmod.tr/wiki/Entity) ent, [string](https://gmod.tr/wiki/string) type )

Bulunan varlığa doğrudan bağlı belirli bir türdeki ilk kısıtlamayı döndürür.

[Entity](https://gmod.tr/wiki/Entity) constraint.[FindConstraintEntity](https://gmod.tr/wiki/constraint.FindConstraintEntity)( [Entity](https://gmod.tr/wiki/Entity) ent, [string](https://gmod.tr/wiki/string) type )

Varlığa doğrudan bağlı belirli bir türdeki ilk kısıtlamada yer alan diğer varlığı döndürür.

[table](https://gmod.tr/wiki/table) constraint.[FindConstraints](https://gmod.tr/wiki/constraint.FindConstraints)( [Entity](https://gmod.tr/wiki/Entity) ent, [string](https://gmod.tr/wiki/string) type )

Varlığa doğrudan bağlı belirli bir türdeki tüm kısıtlamaların bir tablosunu döndürür. Tüm kısıtlamaların bir listesini arıyorsanız, constraint.GetTable'ı kullanın.

constraint.[ForgetConstraints](https://gmod.tr/wiki/constraint.ForgetConstraints)( [Entity](https://gmod.tr/wiki/Entity) ent )

Bu varlığın bildiği tüm kısıtlamaları unutmasını sağlar. Unutmayın ki bu, kısıtlamaları gerçekten kaldırmaz.

[table](https://gmod.tr/wiki/table) constraint.[GetAllConstrainedEntities](https://gmod.tr/wiki/constraint.GetAllConstrainedEntities)( [Entity](https://gmod.tr/wiki/Entity) ent, [table](https://gmod.tr/wiki/table) resultTable = nil )

Bir varlığa özyinelemeli olarak kısıtlanmış tüm varlıkların bir tablosunu döndürür.

[table](https://gmod.tr/wiki/table) constraint.[GetTable](https://gmod.tr/wiki/constraint.GetTable)( [Entity](https://gmod.tr/wiki/Entity) ent )

Varlığa doğrudan bağlı tüm kısıtlamaların bir tablosunu döndürür. Belirli kısıtlama(lar)ın bir listesini arıyorsanız, constraint.FindConstraints'ı kullanın.

[boolean](https://gmod.tr/wiki/boolean) constraint.[HasConstraints](https://gmod.tr/wiki/constraint.HasConstraints)( [Entity](https://gmod.tr/wiki/Entity) ent )

Varlığa bağlı kısıtlamalar varsa true döndürür.

[Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity) constraint.[Hydraulic](https://gmod.tr/wiki/constraint.Hydraulic)( [Player](https://gmod.tr/wiki/Player) player, [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) length1, [number](https://gmod.tr/wiki/number) length2, [number](https://gmod.tr/wiki/number) width, [number](https://gmod.tr/wiki/number) key, [number](https://gmod.tr/wiki/number) slider, [number](https://gmod.tr/wiki/number) speed, [string](https://gmod.tr/wiki/string) material = "", [boolean](https://gmod.tr/wiki/boolean) toggle = true, [table](https://gmod.tr/wiki/table) color = color_white )

Kontrol edilebilir bir kısıtlama oluşturur. Elastik, yani bir Hidrolik kısıtlaması.

[Entity](https://gmod.tr/wiki/Entity) constraint.[Keepupright](https://gmod.tr/wiki/constraint.Keepupright)( [Entity](https://gmod.tr/wiki/Entity) ent, [Angle](https://gmod.tr/wiki/Angle) ang, [number](https://gmod.tr/wiki/number) bone, [number](https://gmod.tr/wiki/number) angularLimit )

Bir dik tutma kısıtlaması oluşturur.

[Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity) constraint.[Motor](https://gmod.tr/wiki/constraint.Motor)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) friction, [number](https://gmod.tr/wiki/number) torque, [number](https://gmod.tr/wiki/number) forcetime, [number](https://gmod.tr/wiki/number) nocollide = 0, [number](https://gmod.tr/wiki/number) toggle = false, [Player](https://gmod.tr/wiki/Player) player = NULL, [number](https://gmod.tr/wiki/number) forcelimit = 0, [number](https://gmod.tr/wiki/number) key_fwd = nil, [number](https://gmod.tr/wiki/number) key_bwd = nil, [number](https://gmod.tr/wiki/number) direction = 1, [Vector](https://gmod.tr/wiki/Vector) localAxis = nil )

Bir motor kısıtlaması, yani oyuncu tarafından kontrol edilebilen bir Eksen kısıtlaması oluşturur.

[Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity) constraint.[Muscle](https://gmod.tr/wiki/constraint.Muscle)( [Player](https://gmod.tr/wiki/Player) player, [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) length1, [number](https://gmod.tr/wiki/number) length2, [number](https://gmod.tr/wiki/number) width, [number](https://gmod.tr/wiki/number) key, [number](https://gmod.tr/wiki/number) fixed, [number](https://gmod.tr/wiki/number) period, [number](https://gmod.tr/wiki/number) amplitude, [boolean](https://gmod.tr/wiki/boolean) startOn = false, [string](https://gmod.tr/wiki/string) material = "", [table](https://gmod.tr/wiki/table) color = color_white )

Bir kas (muscle) kısıtlaması oluşturur. constraint.Hydraulic'e çok benzer, ancak tamamen genişlemiş ve büzülmüş durumlar arasında geçiş yapmak yerine, etkinleştirildiğinde sürekli olarak 2 durum arasında geçiş yapar.

[Entity](https://gmod.tr/wiki/Entity) constraint.[NoCollide](https://gmod.tr/wiki/constraint.NoCollide)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [boolean](https://gmod.tr/wiki/boolean) disableOnRemove = false )

Bir çarpışmasızlık "kısıtlaması" oluşturur. İki varlık arasındaki çarpışmayı devre dışı bırakır. Oyuncularla çalışmaz.

[Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity) constraint.[Pulley](https://gmod.tr/wiki/constraint.Pulley)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent4, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone4, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos4, [Vector](https://gmod.tr/wiki/Vector) worldPos2, [Vector](https://gmod.tr/wiki/Vector) worldPos3, [number](https://gmod.tr/wiki/number) forceLimit, [boolean](https://gmod.tr/wiki/boolean) rigid = false, [number](https://gmod.tr/wiki/number) width, [string](https://gmod.tr/wiki/string) material = "", [table](https://gmod.tr/wiki/table) color = color_white )

Bir makara kısıtlaması oluşturur. 3 ip segmentinden oluşur, bunlardan 2'si değişken uzunluktadır ve görsel olarak bir 3. tarafından bağlanır. Bir ucun uzunluğunu azaltmak, diğer ucun uzunluğunu artıracaktır. Makarayı şu şekilde görselleştirebilirsiniz: WPos2 --- WPos3 | | | | Ent1 Ent4

[boolean](https://gmod.tr/wiki/boolean), [number](https://gmod.tr/wiki/number) constraint.[RemoveAll](https://gmod.tr/wiki/constraint.RemoveAll)( [Entity](https://gmod.tr/wiki/Entity) ent )

Bir varlıkla ilişkili tüm kısıtlamaları kaldırmaya çalışır.

[boolean](https://gmod.tr/wiki/boolean), [number](https://gmod.tr/wiki/number) constraint.[RemoveConstraints](https://gmod.tr/wiki/constraint.RemoveConstraints)( [Entity](https://gmod.tr/wiki/Entity) ent, [string](https://gmod.tr/wiki/string) type )

Bir varlıkla ilişkili belirli bir türdeki tüm kısıtlamaları kaldırmaya çalışır.

[Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity) constraint.[Rope](https://gmod.tr/wiki/constraint.Rope)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) length, [number](https://gmod.tr/wiki/number) addLength = 0, [number](https://gmod.tr/wiki/number) forceLimit = 0, [number](https://gmod.tr/wiki/number) width, [string](https://gmod.tr/wiki/string) material = "", [boolean](https://gmod.tr/wiki/boolean) rigid = false, [table](https://gmod.tr/wiki/table) color = color_white )

Basit bir ip (uzunluk) tabanlı kısıtlama oluşturur.

[Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity) constraint.[Slider](https://gmod.tr/wiki/constraint.Slider)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) width, [string](https://gmod.tr/wiki/string) material = "", [table](https://gmod.tr/wiki/table) color = color_white )

Bir kaydırıcı (slider) kısıtlaması oluşturur. Kaydırıcı bir ip gibidir, ancak kısıtlanmış nesnenin yalnızca 1 yönde hareket etmesine izin verir.

[Entity](https://gmod.tr/wiki/Entity) constraint.[Weld](https://gmod.tr/wiki/constraint.Weld)( [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [number](https://gmod.tr/wiki/number) forceLimit = 0, [boolean](https://gmod.tr/wiki/boolean) noCollide = false, [boolean](https://gmod.tr/wiki/boolean) deleteEnt1OnBreak = false )

Bir kaynak (weld) kısıtlaması oluşturur.

[Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity), [Entity](https://gmod.tr/wiki/Entity) constraint.[Winch](https://gmod.tr/wiki/constraint.Winch)( [Player](https://gmod.tr/wiki/Player) player, [Entity](https://gmod.tr/wiki/Entity) ent1, [Entity](https://gmod.tr/wiki/Entity) ent2, [number](https://gmod.tr/wiki/number) bone1, [number](https://gmod.tr/wiki/number) bone2, [Vector](https://gmod.tr/wiki/Vector) localPos1, [Vector](https://gmod.tr/wiki/Vector) localPos2, [number](https://gmod.tr/wiki/number) width, [number](https://gmod.tr/wiki/number) fwdBind, [number](https://gmod.tr/wiki/number) bwdBind, [number](https://gmod.tr/wiki/number) fwdSpeed, [number](https://gmod.tr/wiki/number) bwdSpeed, [string](https://gmod.tr/wiki/string) material = "", [boolean](https://gmod.tr/wiki/boolean) toggle = false, [table](https://gmod.tr/wiki/table) color = color_white )

Bir vinç (winch) kısıtlaması, yani oyuncu tarafından kontrol edilebilen bir kısıtlama oluşturur. Elastiktir ve uzunluğun kademeli olarak artırılmasına veya azaltılmasına olanak tanır.

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/constraint
