No announcement yet.

Can't Get smooth movement in Turn-Based Game

  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Update: Found my way to the solution. The issue was I was concentrating too much logic in the Player Controller. The movement logic works best inside the pawn itself.

    Leave a comment:

  • started a topic Can't Get smooth movement in Turn-Based Game

    Can't Get smooth movement in Turn-Based Game

    Hey guys!

    I'm making a game like Monopoly, with pawns moving in a linearly square board. I have a Player Controller moving two Pawns. They're moving in the right logic, advancing one house at a time according to Action Points (there's a 'Play Dice' button that each player gets in the beginning of a turn and the result is stored in AP and used for movement). I've researched how to do that and I was pointed to Timeline, AI Move To, Simple Move to Location, but appareantly I'm doing something wrong because nothing is working properly.

    I managed to get stepped/teleport movement with Add Actor Local Offset, getting Actor Location and adding 100 units to the location (100 is the size of each tile). While trying to get a smooth movement, I've added a simple Timeline that gets 0 to 1 value in 0 to 1 seconds. The current behavior is that the Pawn is moving crazily way more than it should and it is not respecting the action points, advancing the right number of houses.

    Ideally I need the pawns to move smoothly in local X, advancing one house per AP, and in local Z, going up and down to simulate a boardgame pawn movement.

    Any ideas?

    Thanks a lot!

    Here are some screens:

    The Game
    Click image for larger version

Name:	Game.JPG
Views:	1
Size:	153.4 KB
ID:	1205117

    Movement logic
    Click image for larger version

Name:	MovePawn2.JPG
Views:	1
Size:	116.0 KB
ID:	1205118

    Manual While Loop (I call the Move Pawn function for each AP the player gets)
    Click image for larger version

Name:	MovePawn1.JPG
Views:	1
Size:	103.6 KB
ID:	1205119
    Last edited by Harry Florencio; 01-08-2017, 03:55 PM.