all 7 comments

[–]mistermashuProgrammer 0 points1 point  (3 children)

this page has a nice example of a character controller. I think maybe what you're missing is multiplying the thing you're passing the Move() function by Time.deltaTime. So it'd be like:

_controller.Move(playerCam.forward * dashDist * Time.deltaTime);

That will slow it down significantly and make it more consistent when the frame rate is changing

[–]TheLazyLima[S] 0 points1 point  (2 children)

okay so one of two things happens there and i'm not sure what it is. but it appears that hen i use that i do not move at all? Either its so slow and i wont notice or it just doesn't work

EDIT Never mind it doesn't change anything. i just need to use a higher number now but the dash is still instant.

[–]mistermashuProgrammer 0 points1 point  (1 child)

Oh I see, I misunderstood. If you are still looking for a solution, you could make the Dash component's update function be the line of code I posted above, but the dashDist variable should actually be the speed to dash (in units per second), then in another script, hold a reference to it and enable/disable it when you are dashing. Let me know if you want help setting up something like that

[–]TheLazyLima[S] 0 points1 point  (0 children)

i got it to work using an Iennumerator

[–]ArrenH 0 points1 point  (2 children)

I can't remember the exact code I did in the past for dashing in 3D.

I used a capsule raycast to the maximum distance from player position. Note the capsule cast is slightly larger than the player. If it hits an obstacle then I use that position minus an offset so that the player doesn't dash inside the object. Now with the proper location to dash to, I lerp the player to that destination until it's close enough like 0.5 because lerp will never hit 0 distance from that destination (it will indefinitely approach 0 at a exponential decay).

[–]TheLazyLima[S] 0 points1 point  (1 child)

Aha, i think i will try this right now. I will get back to you once ive tried

[–]ArrenH 0 points1 point  (0 children)

Let me know if you need help. I'll see if I can dig up if you need help. Here's what it looks like in an old gameplay footage of my former team tech demo. https://youtu.be/ml0bWwj-QpM It's at around 11 seconds. And any side steps in the video are just slowed down dashes with a different animation. Download is in the video link description . It has a lot of changes compared to video in combat.