# WEAPON:GetViewModelPosition

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

```lua
Vector, Angle WEAPON:GetViewModelPosition( Vector EyePos, Angle EyeAng )
```

## Açıklama

Bu hook, view model (silah modeli) pozisyonunu ve açılarını ayarlamanıza olanak tanır.

## Argümanlar

1. [Vector](https://gmod.tr/wiki/Vector) **EyePos**: Mevcut pozisyon
2. [Angle](https://gmod.tr/wiki/Angle) **EyeAng**: Mevcut açı

## Dönüş Değerleri

1. [Vector](https://gmod.tr/wiki/Vector): Yeni pozisyon
2. [Angle](https://gmod.tr/wiki/Angle): Yeni açı

### Örnek

Bu kod, sabit ofsetlere dayanarak orijinal viewmodel'i hareket ettirir ve döndürür, böylece oyuncunun önündeki bekleme pozisyonunu değiştirir.

```lua
-- Viewmodel'in pozisyonunu hareket ettirmek için bu değişkenleri ayarlayın
SWEP.IronSightsPos  = Vector(9.49, 10.5, -12.371)
SWEP.IronSightsAng  = Vector(12, 65, -22.19)

function SWEP:GetViewModelPosition(EyePos, EyeAng)
	local Mul = 1.0

	local Offset = self.IronSightsPos

	if (self.IronSightsAng) then
        EyeAng = EyeAng * 1

		EyeAng:RotateAroundAxis(EyeAng:Right(), 	self.IronSightsAng.x * Mul)
		EyeAng:RotateAroundAxis(EyeAng:Up(), 		self.IronSightsAng.y * Mul)
		EyeAng:RotateAroundAxis(EyeAng:Forward(),   self.IronSightsAng.z * Mul)
	end

	local Right 	= EyeAng:Right()
	local Up 		= EyeAng:Up()
	local Forward 	= EyeAng:Forward()

	EyePos = EyePos + Offset.x * Right * Mul
	EyePos = EyePos + Offset.y * Forward * Mul
	EyePos = EyePos + Offset.z * Up * Mul

	return EyePos, EyeAng
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/WEAPON:GetViewModelPosition
