swayer
Centipat
- Katılım
- 7 Ağustos 2024
- Mesajlar
- 194
- Çözümler
- 6
Daha fazla
- Cinsiyet
- Erkek
- Meslek
- Müzisyen
Arkadaşlar merhaba, bir tane oyun yapıyorum ancak fareyi ben nereye döndürsem o yönün tersine gidiyor sizce sıkıntı nedir?
Kodlar:
Using unityengine;
Public class mouselookaround: Monobehaviour.
{
Float rotationx = 0F;
Float rotationy = 0F;
Public Vector2 sensitivity = Vector2.One * 360F;
Void Update()
{
Rotationy += ınput. Getaxis("mouse X") * time. Deltatime * sensitivity. X;
Rotationx += ınput. Getaxis("mouse y") * time. Deltatime * -1 * sensitivity. Y;
Transform. Localeulerangles = New Vector3(rotationx, rotationy, 0);
}
}
Kodlar:
Using unityengine;
Public class mouselookaround: Monobehaviour.
{
Float rotationx = 0F;
Float rotationy = 0F;
Public Vector2 sensitivity = Vector2.One * 360F;
Void Update()
{
Rotationy += ınput. Getaxis("mouse X") * time. Deltatime * sensitivity. X;
Rotationx += ınput. Getaxis("mouse y") * time. Deltatime * -1 * sensitivity. Y;
Transform. Localeulerangles = New Vector3(rotationx, rotationy, 0);
}
}