- Home /
Question by
Kryniu · Mar 19, 2020 at 01:50 PM ·
movementgetkeydown
Movement with GetKeyDown
Hi guys. I was making a combo system in 2D Game and i want to add secondary movement for my player in every attack. I mean when i attack my player should slightly move towards attack direction like in Sekiro or Dead Cells. I have tried today but i only get something like teleport. I used this code
if (Input.GetKeyDown(KeyCode.Space)) { transform.Translate(Vector2.right AttackSpeed Time.deltaTime, Space.Self); } where AttackSpeed is float and i set him for 3 and of course this is "working" only on right direction.
Comment