Currently making a Melee System and wish for it to have directional slashing & blocking. This means if you slash upwards, then it detects that, and plays an upwards slashing animation, slashing downwards would play an overhead down slash. Blocking and aiming left, plays a left block animation, etc. You get the point.
How would I detect this though? What is the best way that is still easy to manage?
you would use your mouse positions and detect it going up etc, also I would use Tweening services for making the Animations, but Highly recommend getting mouse positions and checks the Y Vector of the mouse and the Z or X and see it go up or down or left or right.
I’ve seen a few solutions now, but my issue is none of them work because my combat system is in shiftlock, and it doesn’t detect motion when you are in shiftlock. Can anyone tell me a solution that would work w/ shiftlock? Thank you.
UserInputService.InputChanged:Connect(function(input,gp)
if gp then return end
if input.UserInputType == Enum.UserInputType.MouseMovement then
local AbsX = math.abs(input.Delta.X)
local AbsY = math.abs(input.Delta.Y)
if AbsX > 0 or AbsY > 0 then
-- X Axis Movement
if input.Delta.X > 0 then
currentDirection = "Right"
elseif input.Delta.X < 0 then
currentDirection = "Left"
end
-- Y Axis Movement
if input.Delta.Y < 0 then
if AbsY * 3 > AbsX then
currentDirection = "Up"
end
elseif input.Delta.Y > 0 then
if AbsY * 3 > AbsX then
currentDirection = "Down"
end
end
end
end
end)
Solution I used for those who are curious. Works with Shiftlock.