samet36
Centipat
- Katılım
- 1 Ağustos 2022
- Mesajlar
- 613
Daha fazla
- Cinsiyet
- Erkek
Unity zıplama animasyonu Space'e basılı tutunca çalışıyor ben direk Space'e basılınca çalışmasını istiyorum nasıl yaparım?
Kod:
Using System. Collections;
Using System. Collections. Generic;
Using unityengine;
Public class zıplama: Monobehaviour.
{
Float Speed = 0.25F;
Float rotspeed = 80;
Float gravity = 8;
Float rot = 0;
Vector3 movedir = Vector3.Zero;
Charactercontroller kontrol;
Animator anim;
Void Start()
{
Kontrol = GetComponent<CharacterController>();
Anim = GetComponent<Animator>();
}
Void Update()
{
İf (kontrol. İsgrounded)
{
İf (ınput. Getkey(keycode. Space))
{
Movedir = New Vector3(0, 0, 1);
Movedir *= Speed;
Anim. Setınteger("zıplamalar", 1);
Movedir = transform. Transformdirection(movedir);
}
Else.
{
Movedir = New Vector3(0, 0, 0);
Anim. Setınteger("zıplamalar", 0);
}
}
}
}
Kod:
Using System. Collections;
Using System. Collections. Generic;
Using unityengine;
Public class zıplama: Monobehaviour.
{
Float Speed = 0.25F;
Float rotspeed = 80;
Float gravity = 8;
Float rot = 0;
Vector3 movedir = Vector3.Zero;
Charactercontroller kontrol;
Animator anim;
Void Start()
{
Kontrol = GetComponent<CharacterController>();
Anim = GetComponent<Animator>();
}
Void Update()
{
İf (kontrol. İsgrounded)
{
İf (ınput. Getkey(keycode. Space))
{
Movedir = New Vector3(0, 0, 1);
Movedir *= Speed;
Anim. Setınteger("zıplamalar", 1);
Movedir = transform. Transformdirection(movedir);
}
Else.
{
Movedir = New Vector3(0, 0, 0);
Anim. Setınteger("zıplamalar", 0);
}
}
}
}