@@ -1042,17 +1042,28 @@ automoverActorFunctions.updateDirectionsFromActorControllerInput = function(self
1042
1042
1043
1043
actorData .direction = Directions .None ;
1044
1044
1045
- if not actorController :IsState (Controller .PIE_MENU_ACTIVE ) then
1046
- if actorController :IsState (Controller .PRESS_UP ) or actorController :IsState (Controller .HOLD_UP ) then
1047
- actorData .direction = Directions .Up ;
1048
- elseif actorController :IsState (Controller .PRESS_DOWN ) or actorController :IsState (Controller .HOLD_DOWN ) then
1049
- actorData .direction = Directions .Down ;
1050
- elseif actorController :IsState (Controller .PRESS_LEFT ) or actorController :IsState (Controller .HOLD_LEFT ) then
1051
- actorData .direction = Directions .Left ;
1052
- elseif actorController :IsState (Controller .PRESS_RIGHT ) or actorController :IsState (Controller .HOLD_RIGHT ) then
1053
- actorData .direction = Directions .Right ;
1045
+ local deadZone = 0.1 ;
1046
+ local analogMove = actorController .AnalogMove ;
1047
+ if analogMove :MagnitudeIsGreaterThan (deadZone ) then
1048
+ if math.abs (analogMove .X ) < math.abs (analogMove .Y ) then
1049
+ actorData .direction = analogMove .Y > 0 and Directions .Down or Directions .Up ;
1050
+ else
1051
+ actorData .direction = analogMove .X > 0 and Directions .Right or Directions .Left ;
1052
+ end
1053
+ else
1054
+ if not actorController :IsState (Controller .PIE_MENU_ACTIVE ) then
1055
+ if actorController :IsState (Controller .PRESS_UP ) or actorController :IsState (Controller .HOLD_UP ) then
1056
+ actorData .direction = Directions .Up ;
1057
+ elseif actorController :IsState (Controller .PRESS_DOWN ) or actorController :IsState (Controller .HOLD_DOWN ) then
1058
+ actorData .direction = Directions .Down ;
1059
+ elseif actorController :IsState (Controller .PRESS_LEFT ) or actorController :IsState (Controller .HOLD_LEFT ) then
1060
+ actorData .direction = Directions .Left ;
1061
+ elseif actorController :IsState (Controller .PRESS_RIGHT ) or actorController :IsState (Controller .HOLD_RIGHT ) then
1062
+ actorData .direction = Directions .Right ;
1063
+ end
1054
1064
end
1055
1065
end
1066
+
1056
1067
if actorData .movementMode ~= self .movementModes .unstickActor then
1057
1068
if actorData .direction == Directions .None and actorData .movementMode ~= self .movementModes .leaveAutomovers then
1058
1069
actorData .movementMode = self .movementModes .freeze ;
0 commit comments