Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

hi, you have to use the setVelocity() function each time you want to set it (at the end of each if (Sup.Input.isKeyDown)

this.actor.arcadeBody2D.setVelocityX(velocity.x);

without it, your actor doesn't know it will have to move.

don't forget that if you release your finger from the key, your actor should stop, so in your else (for idle position) under the line

this.actor.spriteRenderer.setAnimation(this.currentIdle);

set the velocity to 0.

this.actor.arcadeBody2D.setVelocityX(0);


Hope it helps ;)