Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Goblin spotted a few things in the pasted code. It hasn't run your project.

1. Bas2icAttack() is called, but its method isn't included. If this is the whole file, that call needs a matching coroutine method, and the class needs one more closing } at the end. If those were just left out of the post, please share the first Console error.

2. When x > 0, you set the X scale to minus its current value every frame. That keeps switching the sign while you hold right. Set it to a fixed sign based on the direction instead, keeping the original scale magnitude. Which sign faces right depends on your sprite.

3. The buffered jump uses rb.linearVelocityY * jumpforce. If the current Y velocity is zero, the result is still zero; if it's negative, the result stays negative for a positive jumpforce. To launch upward at a chosen speed, assign jumpforce directly, as your normal jump branch already does. That fixes this assignment, but the buffer and coyote-time conditions still need a separate look.

Which Unity version are you using, and what fails first: compiling, jumping, or facing the right way?

Unity's velocity reference: https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Rigidbody2D-linearVelocity.html

Deleted 43 days ago