- Joined
- Apr 18, 2012
- Messages
- 37
- Reaction score
- 4
- First Language
- English
- Primarily Uses
I'm attempting to use setDestination to allow activation of events via mouse click, while simultaneously disabling mouse click to move. setDestination appears to be used for both actions, so I'm attempting to parse out the functionality. I've listed some initial code below but it seems to be throwing a 'property of undefined findDirectionTo' error. I'm also unsure if I'm on the right track with this. Any insight would be helpful.
JavaScript:
Game_Temp.prototype.setDestination = function(x, y) {
let goalX = x;
let goalY = y;
// compare the current position to the goal position to get the direction
let direction = this._player.findDirectionTo(goalX, goalY);
// if the direction is 0, then the player is already at the goal position
if (direction > 0) {
checkEventTriggerTouchFront(direction);
}
};