basically look up down right left
it would be a nice funny feature in a game
it would be a nice funny feature in a game
/*: * @plugindesc KaiMonkey's Player Face Mouse * @author Kaimonkey * @param Disable While Moving * @desc Set to True to avoid crazy ballerina sliding shenanigans * @default true */(function() { //Start Plugin var parameters = PluginManager.parameters('KaimonkeyMouseFace'); var disableWhileMoving = String(parameters['Disable While Moving']); /* TouchInput._onMouseMove = function(event) { if (this._mousePressed) { var x = Graphics.pageToCanvasX(event.pageX); var y = Graphics.pageToCanvasY(event.pageY); this._onMove(x, y); } }; */ _km_player_face_onMove = TouchInput._onMouseMove; //Create Alias TouchInput._onMouseMove = function(event) { _km_player_face_onMove.call(event); //Call Alias if(!$gamePlayer || !$dataMap){ return; } if(disableWhileMoving=="true"){ if($gamePlayer.isMoving()){ return; } } var px = $gamePlayer.scrolledX()*48 + 24; var px = $gamePlayer.scrolledX()*48 + 24; var mx = event.x; var my = event.y; var x = mx - px; var y = my - px; if(y > x && y > -x){ $gamePlayer.setDirection(2); }else if(y < x && y < -x){ $gamePlayer.setDirection(8); }else if(x > y && x > -y){ $gamePlayer.setDirection(6); }else if(x < y && x < -y){ $gamePlayer.setDirection(4); } };})(); //Close Plugin
/*: * @plugindesc KaiMonkey's Player Face Mouse * @author Kaimonkey * @param Disable While Moving * @desc Set to True to avoid crazy ballerina sliding shenanigans * @default true */(function() { //Start Plugin var parameters = PluginManager.parameters('KaimonkeyMouseFace'); var disableWhileMoving = String(parameters['Disable While Moving']);/*TouchInput._onMouseMove = function(event) { if (this._mousePressed) { var x = Graphics.pageToCanvasX(event.pageX); var y = Graphics.pageToCanvasY(event.pageY); this._onMove(x, y); }};*/ _km_player_face_onMove = TouchInput._onMouseMove; //Create Alias TouchInput._onMouseMove = function(event) {_km_player_face_onMove.call(event); //Call Aliasif(!$gamePlayer || !$dataMap){return;} if(disableWhileMoving=="true"){if($gamePlayer.isMoving()){return;} }var px = $gamePlayer.scrolledX()*48 +24;var py = $gamePlayer.scrolledY()*48 +24;var mx = event.x;var my = event.y;var x = mx - px;var y = my - py;if(y > x && y > -x){$gamePlayer.setDirection(2);}else if(y < x && y < -x){$gamePlayer.setDirection(8);}else if(x > y && x > -y){$gamePlayer.setDirection(6);}else if(x < y && x < -y){$gamePlayer.setDirection(4);}};})(); //Close Plugin
Original thread: https://forums.rpgmakerweb.com/threads/im-looking-for-a-script-where-the-actor-follows-the-mouse-looks-in-that-direction-where-the-mouse.47990/