|
Post by darkstar on Apr 25, 2017 22:43:53 GMT
Hello everyone! I'm not much of a programmer and I was hoping someone could help me make a dash script for my project. A dash similar in the game Recore, like in this video: I want to make it work with Invector's lock-on, while in lock-on the player needs to dash away from the enemy in all directions. Also the moment you press "Dash", I want the player to dash in a straight line, right now the player can still move left and right while"dashing".
This is what I was able to make, I don't know how to add animations yet, but currently I have no Dash animation so that can wait.
|
|
|
Post by uberwiggett on Apr 26, 2017 2:39:16 GMT
To be honest it would probably be simpler to just change the animations for "roll" or if you wanted to keep the roll option, duplicate the roll section in the animator and rename it dash, replace anims, and duplicate the code function that triggers the roll and map it to a key.
I don't have any dash animations that I know of but I might be able to work something out and make a video of it later if you're not to sure how to change it.
|
|
|
Post by darkstar on Apr 26, 2017 5:56:17 GMT
Oke that doesn't sound too hard I guess, the roll function in vThirdPersonController is that the only class that needs to be edited?
|
|
|
Post by uberwiggett on Apr 26, 2017 7:46:31 GMT
well you can try the jump, but the roll is the closest to match what you want with the dash. It activates the animation which propels you in a direction you want. Pretty sure it works during lock on too.
|
|
|
Post by snackzilla on Apr 26, 2017 16:44:22 GMT
I replaced the "Roll" animation with a forward dash, and it works great. I suppose if you wanted to keep both actions, you could create your own, but since my roll has the parameters already set up (roll left/right), it worked perfectly for a "Dash" animation. Just throwing that out there P.S. I can confirm dashing around the target DOES indeed work during lock-on.
|
|
|
Post by darkstar on Apr 26, 2017 20:01:23 GMT
Snackzilla, do you have a Dash animation that I can use? I'm trying to find one in the unity asset store but they all come in packages and cost 20 bucks at least.
|
|
|
Post by snackzilla on Apr 26, 2017 22:29:59 GMT
I'm sorry DarkStar! I actually bought mine also, so I cannot legally give it away. I CAN tell you what asset pack it came out of though. It was the BlueIsland Dynamic Sword Animation set. It's quite pricey, and not all the animations have root motion, but it's some of the smoothest animations I've seen on the asset store.
|
|
|
Post by darkstar on Apr 27, 2017 9:01:50 GMT
Hey snackzilla thnx for telling me the pack, I bought it too and it's fantastic! However what I now want to do is make an airdash. do you know how to do this? Also this "Dash" goes straight through walls it doesn't collide is this easy to fix?
thanks in advance!
|
|
|
Post by snackzilla on Apr 27, 2017 11:23:47 GMT
If your dash is going through walls, I'd check your layers. Make sure your player is set to the "Player" layer, and everything else, scenery and whatnot, needs to be on the "Default" layer. Also, it'd be worth checking to make sure that the animation isn't leaving the capsule collider behind. I've had some animations do that before, specifically jumping ones. One way to see if it is, is to "Play" your game, initiate your Dash, animation, and while it's playing, pause the game. Then go to the scene mode, select your character in the hierarchy and check where the capsule collider is. If it's way behind the player, then something isn't set up correctly. As for the Air-Dash, I'm actually working on that exact thing right now over on this thread: invector.proboards.com/thread/405/jumping-falling-animation-questionI haven't got it quite working yet, but I'll post a video if I do.
|
|
|
Post by shadex on Apr 27, 2017 19:50:43 GMT
Hey snackzilla thnx for telling me the pack, I bought it too and it's fantastic! However what I now want to do is make an airdash. do you know how to do this? Also this "Dash" goes straight through walls it doesn't collide is this easy to fix? thanks in advance! I'll be looking into this shortly myself, but what you want to do is remove the condition in roll that prevents you from rolling while something is !grounded (not grounded). If you remove that, the same dash your using you would be able to use in the air AFTER you jumped, effectivly making an airdash. I personally want to add a roll-slash
|
|
|
Post by snackzilla on Apr 28, 2017 2:19:40 GMT
Hey Shadex! Haven't been in a thread with you in a while. I'm actually doing this AirDash thing RIGHT now. The problem is that for some reason, I had to cheat, and use an InPlace animation, and manually add the velocity whilst in the air. Removing the condition for rolling in the air DOES let the animation play, but when I was talking to Invector in my other thread, it's unfortunately not that simple. Right now, I've got AirDash working, with the exception of the AirPhysics turning into slippyPhysics on the player rigidbody as soon as it's not grounded. For now, I just commented out the part that made the capsule collider change materials. I'll upload a gif here, and in my other thread before I go to bed. EDIT: As Promised. I've got it SORT of working. Here's a link to the thread of me talking it through with Invector when they reply, and here's how it's coming along currently. Right now it's got a weird slingshot bug that makes things quite odd. Thread: invector.proboards.com/thread/405/jumping-falling-animation-question?page=1&scrollTo=4759Video:
|
|
|
Post by shadex on Apr 28, 2017 17:06:06 GMT
Hey Shadex! Haven't been in a thread with you in a while. I'm actually doing this AirDash thing RIGHT now. The problem is that for some reason, I had to cheat, and use an InPlace animation, and manually add the velocity whilst in the air. Removing the condition for rolling in the air DOES let the animation play, but when I was talking to Invector in my other thread, it's unfortunately not that simple. Right now, I've got AirDash working, with the exception of the AirPhysics turning into slippyPhysics on the player rigidbody as soon as it's not grounded. For now, I just commented out the part that made the capsule collider change materials. I'll upload a gif here, and in my other thread before I go to bed. EDIT: As Promised. I've got it SORT of working. Here's a link to the thread of me talking it through with Invector when they reply, and here's how it's coming along currently. Right now it's got a weird slingshot bug that makes things quite odd. Thread: invector.proboards.com/thread/405/jumping-falling-animation-question?page=1&scrollTo=4759Video: That's not cheating, thats how your suppose to do it. You don't want root motion in the animation. What you want to do is setup a blend tree that uses velocity and ground distance to blend 2 separate parts of the animation. That way you can have a smooth flight to landing animation and have a fast to slow flying animations. This would allow the dash to work reguardless of the distance your dashing, and would be already setup for things like flying. To be honest though, it looks really good as is. The air dash slingshot seems to happen when you air dash right as the character is landing. If that is reliable, you might want to even think of keeping that in. It's a skill based movement that has to be timed just right, but rewards you with ultra fast movement boosts. Oh for the slingshot thing, turn on your stamina for dashing if you can. I'm betting that the slingshot is happening when your right at the "grounded" state, and for whatever reason it is having the character do the air dash and ground dash at the same time, hence the double distance of the dash. If you turn on stamina you can see if the stamina use is doubled, or alternativly open up the animator and use the auto link and variables to see if both are being triggered at the same time.
|
|
|
Post by snackzilla on Apr 28, 2017 17:55:23 GMT
Thanks for the suggestion! I'm about to try this right now!
Edit: Alright, so I'm still not sure what's going on. It's using only the amount of stamina for one Dash, even when he slingshots across the terrain. Going to try a couple other things! Your suggestion about flying gave me an idea to checkout that Flying add-on that dude coded a while back and see how he handled the velocity and such. Thanks again!
|
|
|
Post by darkstar on May 4, 2017 8:49:45 GMT
Hey snack, how's it going with your dash ability?
I've been trying to get mine working too but to no avail, any tips on what scripts I should edit? or what conditions I should add to the animator?
|
|
|
Post by snackzilla on May 4, 2017 12:02:46 GMT
Hey snack, how's it going with your dash ability? I've been trying to get mine working too but to no avail, any tips on what scripts I should edit? or what conditions I should add to the animator? I actually got frustrated because I couldn't figure out why the character was shooting across the ground like a crazy person..but only sometimes. I'm going to mess with a different way of going about it as soon as I have the time. As far as animator parameters, what Invector said earlier up worked. Manipulating the "ActionState" integer via script, and adding a condition on enter/exit of the jump will successfully let you do an air dash.
|
|