Thanks for solving my problem. I plan to share my dash code when it is fully functional
3D Movement: Changing Velocity Relative to Direction
Hello. I'm trying to implement 8 directional dashing but it seems like godot favors certain inputs along an axis that is causing errors? Here is what is going on. If Move Left is pressed and then Move Right is pressed while keeping Left pressed, you move left. If Move Right is pressed and then Move Left is pressed while keeping Right pressed, you change to move left.
I think this is messing up my dashing. There are many combinations and I've tested them all.
Forward is pressed + dash right = works
dash_dir_angled = (head_basis.x + -head_basis.z).normalized()
Forward is pressed + dash left = works
dash_dir_angled = (-head_basis.x + -head_basis.z).normalized()
Backward is pressed + dash right = not working, moves straight instead of angled
dash_dir_angled = (head_basis.x + head_basis.z).normalized()
Backward is pressed + dash left = working
dash_dir_angled = (-head_basis.x + head_basis.z).normalized()
Left is pressed + dash forward = works
dash_dir_angled = (-head_basis.x + -head_basis.z).normalized()
Left is pressed + dash backward = works
dash_dir_angled = (-head_basis.x + head_basis.z).normalized()
Right is pressed + dash forward = not working, moves straight instead of angled
dash_dir_angled = (head_basis.x + -head_basis.z).normalized()
Right is pressed + dash backward = works
dash_dir_angled = (head_basis.x + head_basis.z).normalized()
- if (is_dash_angled == true):
- may_dash = false
- velocity.y = dash_hop
- velocity_xz.x = dash_dir_angled.x * dash_speed
- velocity_xz.z = dash_dir_angled.z * dash_speed
So the movement favoring an input direction has something to do with Elifs in regular movement but I don't have elifs in the angled dash movement.
@ps15 said: So the movement favoring an input direction has something to do with Elifs in regular movement but I don't have elifs in the angled dash movement.
pretty sure this is the problem with everything, ill figure it out