I’ve searched a few places, to find a tutorial I’d be able to reverse engineer to fit my criteria and that a relative novice with very little experience with the engine could even hope to reverse engineer, but honestly, I’m burnt out. I figured it’d be better to just ask about what I want directly.
So. I want to make a tile/grid-based movement system employed in older RPG’s; Legend of Zelda, Final Fantasy, etc. I can make a player move a set amount of units in a set direction by setting up Key events. Basically: ‘W’ Pressed → Move X: 100 units. My main issue is that it requires the key be pressed again to move another 100 units, and I can’t figure out a way around that.
It might be something pretty simple that I’m just missing, but I’m at a loss. Any help would be appreciated…
key release interruption needs to be handled better.
For this it might be enough to store the last pressed key to make it work better - kind of depends on how you want the movement direction transition to work. Never played the games mentioned above so not sure about the details but the methods seems solid enough to take it for a spin.
I’ll have a look through the one you posted. It’ll likely take a while for me to get a grasp of it, so I might not have questions for a while (if any at all). Thanks
I would define all the movement keys as either action or axis event in the project settings instead of hardcoding them. For your requirements an Axis mapping seems OK.
You can now add the movement axis event to your Pawn blueprint. An axis event will execute every frame, but if you want to move 100 units in an interval you should add a delay node right after the event which is set to this interval which blocks anything that is faster.
Specify your grid as an integer vector, so that you can move 1, 2, 3 points X or Y without specifying the unit yet, this makes it easier to work with and you can specify a unit later like 1 meter or 50 cm later.
There are easier ways to interpolate actor movement than by doing so through a timeline, timer or tick. There are even existing actor components like InterpMovementTo component which automate this.
Take a look on the marketplace for plugin that auto formats blueprints as it will save you tons of time. Saying this because no one told me to do so when I started and I almost got PTSD formatting the stuff manually but I can see you need it.