- Joined
- Sep 4, 2020
- Messages
- 8
- Reaction score
- 0
- First Language
- English
- Primarily Uses
- RMMV
Hi.. I have a 48x20 world map, and I want an NPC (event) to do patrol from the most left of the map to the most right of the map, back and forth.
So, I did the following
1. Add an event (on location x: 1, y:12)
2. Set image (soldier sprite)
3. Autonomous Movement -> Type: Custom -> Route... -> Script below
4. Options -> Repeat Movements : Checked
And the event did it, but only move it one way.
So, how to do moving back and forth?
So, I did the following
1. Add an event (on location x: 1, y:12)
2. Set image (soldier sprite)
3. Autonomous Movement -> Type: Custom -> Route... -> Script below
Code:
this.moveStraight(this.findDirectionTo(48, 12));
if (this.pos(48, 12)) { this._moveRoute.repeat = false; };
And the event did it, but only move it one way.
So, how to do moving back and forth?

