Turn-based mouse movement

Hello, I am willing to make a turn-based strategy game (similar yet different to Heroes of Might & Magic 3) with a static camera but I can’t seems to find any tutorials that could help me. When the level start, I’m spawning 6 Paper 2D actors (with the SpawnActor node) on the screen and the mouse cursor is correctly showing.

What I would like is that when I hit play, each actors are given a turn order depending on their “initiative” (Int var, located in a DataTable) and the player can automatically click on the screen to make the current actor move to the mouse’s location (X/Y).

I tried some “possess” nodes and played with “Pawn” but when I click on the screen nothing happens. How can I manage to define whose turn it is? Where should I put the code? (inside the Paper 2D actor, the template parent actor, the level blueprint, etc.?). Thanks in advance for your help, I am completely stuck and lost.

Is it a multiplayer game ?

It’s a single player game (rogue-lite) and I want to add a multiplayer later on (similar to Tactical Monster Rumble Arena) but I only want to work on the single player mode as of now

You need to print values of you’r click, possession state, and try to debug this on this way.
Right now, you have no clue of what happen (and it’s normal :p).

Try to figure what doesn’t work by printing value : Where i click ? did my click is registered properly where i want ? is the event is correctly fire ? do my possession work ? etc etc.

Right now I am possessing a specific actor as a placeholder before working on the turn-based system since I need to solve the Mouve movement issue. Below is my current code that tries to move the possessed character (character BP with my Paper 2D character as child actor) to where the mouse is clicked.

When I hit play, the character is moving but not where I want him to go, sometimes moving to a different direction (bottom click and he goes on the left), sometimes not moving at all. The print screen is showing me the mouse location value which are corrects. It looks like it might be a collision issue but I did the same thing as what I saw on tutorials for putting the Navmesh bounds and the actor"s collider looks okay to me. What am I doing wrong ?

For this answer, i think cause you spawn “at camera current location” option.

For you’re code, just print hit actor name when you have the collision

323941-sans-titreasfasfg.png

so you will see if you get the correct actor or… the floor.

debugging is all about printing (and sometime more if you use profiler).

Also, I don’t know if it’s important but when I hit start, the actor I’m using as a pawn is randomly throwed in the air and fall on the ground at a random position. Any idea why this happens?

It reads the name of the Hexgrid cell (Actor containing a Static mesh) I clicked on (ex: cell1.3, cell2.4, etc.). At the end I’d like that when I click on one of these cells, the actor will move to the said cell by passing to each center of the hex grids he encounters on the road (pathfinding?).

I changed the code a little but there’s still the same issue while the mouse position is correct, I even played with the Z value for testing purposes but with no results: the actor keeps moving weirdly as described above. I think that it’s a collision-related issue but I can’t tell what cause the issue.

PS: Spawning was already set to “default player start” and not to “current camera location” surprisingly.

[Update] I have made some progress since the last time and here is my code

With this code I take the location of the Hex cell (Actor>StaticMesh) I click on which will move to the correct given X/Y location while remaining at the same height. This solve my main issue with “Simple Move” which isn’t made for precise movement. Thanks to the [Move Component To function][1].

I also fixed my second issue which was that when my spawned Pawn containing my Paper 2D character was possessed, it would fly away at incredible speed. So what was causing this? I find some similar issue [somewhere][3] and I’ve found that my issue was indeed collision-related. In my capsule
component
, I had to change the collision presets which was “Pawn” with “CharacterMesh”.

Now I need to make the Character move by passing through every center of the Hex cells between the Initial location and the End location. Then I will need to look up for animation. I already have some functions but right now only Z-axis velocity works for my “moveAnimation”. I will do research about that so I can complete my Mouse Movement Goal before working on the Turn-Based possession system.