# PhysObj:GetMaterial

- **Ortam:** İstemci, Sunucu
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/PhysObj:GetMaterial
- **Çeviri tarihi:** 2026-01-24

```lua
string PhysObj:GetMaterial()
```

## Açıklama

Değiştirir [Fiziksel malzeme](https://developer.valvesoftware.com/wiki/Material_surface_properties)Fizik nesnesinin (surfaceprop).

Bakın .[util.GetSurfaceData](https://gmod.tr/wiki/util.GetSurfaceData)bir function that için bu türleri ekler ve ne olduklarını daha fazla açıklar.

## Dönüşler

1. [ip](https://gmod.tr/wiki/string): Fiziksel malzeme adı.

### Örnek

Bir şeye vurduğumuzda uygun bir ses çalın.

```lua
function ENT:Initialize()
	local phys = self.Entity:GetPhysicsObject()
	if IsValid(phys) then
		self.ImpactSound = util.GetSurfaceData(util.GetSurfaceIndex(phys:GetMaterial())).impactHardSound
	end
end

function ENT:PhysicsCollide(data, physobj)
	if (data.Speed > 50) then
		self:EmitSound(Sound(self.ImpactSound))
	end
end
```

- [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/PhysObj:GetMaterial
