feat(player): add directional combat dash - #291
Conversation
There was a problem hiding this comment.
💡 Codex Review
When two fingers interact with the movement zone, every accepted pointer-up calls SimulatePointerUp() because the zone records no active pointer ID. If one finger is holding an outer movement vector and another finger taps and releases in the same zone, the second release publishes the first finger's qualifying vector, causing an unintended dash and clearing the held movement. Capture one pointer on pointer-down and ignore drag/up events from other pointer IDs.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bool wasDashing = IsDashing; | ||
| Vector2 dashVelocity = wasDashing ? dashController.CurrentVelocity : Vector2.zero; |
There was a problem hiding this comment.
Prorate the final dash physics step
When an inspector-tuned dash duration is not an exact multiple of Time.fixedDeltaTime, wasDashing remains true for the entire final physics step and applies full dash velocity before the timer is reduced to zero. For example, a 0.21-second dash at a 0.02-second timestep moves for 0.22 seconds, so actual distance no longer equals the exposed dashSpeed * duration contract; use only the remaining fraction of the last step or otherwise integrate the timer before selecting displacement.
Useful? React with 👍 / 👎.
Why
Player combat needs a reliable active repositioning and dodge option across desktop, gamepad, and Android touch controls without taking ownership from movement, facing, defense, or existing combat-state systems.
What changed
PlayerDashControllerthat owns normalized snapshotted direction, shared directional speed, full/rear duration, cooldown, mobile threshold, and independently timed i-frames0.60duration multiplier at the same speedHow to test
Hands-on MainPrototype validation was completed successfully and the directional combat dash behavior feels correct.
Checklist
Related