Creating an 8-way dashing attack with a fixed distance for use in a sidescroller

So this is a bit of a weird conundrum. Basically, I’m trying to make an attack for my sidescroller game functionally like a combination of something like Bayonetta’s Afterburner Kick in Smash Bros and the 8-way dash from celeste. Basically, an advancing attack that can be angled in the 8 sidescroller directions that travels a fixed distance , aka it doesn’t really carry momentum or factor in pre-existing momentum when starting the attack. As such I want to avoid something like Launch Character.
41DFF7E8-281E-4305-B2DB-D2D95D6E2B07

I figured one way to do this would be through animation, using root motion and such, but I’d prefer to not have to create 8 different animations that each move in different directions, I figured i could make one animation then rotate the mesh to allow the root motion to do the motion for me, though that unfortunately only works on the left/right directions.

I guess I’m basically just looking for ideas/suggestions on how to accomplish something like this, I’m rather inexperienced with tying gameplay mechanics to animation so I’d really appreciate the help.

  • You can use the Stop Movement Immediately node before the Launch Character node.
  • You can use a timeline and update the character’s location with the Add Local Offset node.
  • If you really wanna have control over the exact distance without getting into math, you can create a spline, set one of it’s points to the character’s initial location and the other to the target location, then constrain the character to the spline by constantly setting it’s location to the nearest location on the spline with the Find Location Closest to World Location node (and the coordinate space should be world), and then use the Add Movement Input node (you can constantly trigger it after a Gate node connected to Event Tick, or using timelines, or timers) to move it towards the target location. While doing that, you can constantly check if the character is at the end point of the spline and when it is, you can stop the movement and also stop constraining it to the spline. Oh and you can either increase the air control or temporarily set the movement mode to flying if you want this to also work on air.

Hope these help! :innocent:

I’ve done something similar to the offest idea you suggest. albiet i used world offset instead of local. However, I’ve run into an issue attempting to use the attack upwards while on the ground doesn’t work, it’s almost as if they’re stuck.

This is the code I’m using

Hey @treeese! Sorry for the delay, the website might fail to notify sometimes, I coincidentally saw your topic again from the list that’s under other topics. You can make sure that you indeed notify users by tagging them. (Probably, because other notifications such as likes also don’t get registered sometimes, along with replies. So maybe tags might also not work from time to time, but it’s a good measure.)

Anyways, I think it’d be better if you went with the first approach I suggested. Or try unchecking Sweep.

Let us know how that goes :blush: