Dice, Board game help

I have a board and tiles, i have the dice roll and dice movement. i Have the character move to a set tiles based on number on die, so 1 he goes to 1st tile, 2 he goes to tile 2, there is no adding of numbers its simply set as he goes to the tile the number is associated with, so if hes on tile 6 and you roll a 1 he goes back to tile one, so no actual continuation to movement if that makes sense, i’m just trying to figure out the math and/or how to put a value to the dice so it adds to the movement if that makes sense thanks

I don’t entirely understand what you are asking, but you should be able to move your die with the “MoveComponentTo” node. To find the target location, you could subtract the current tile from the target tile and multiply that by the tile size. For example, if the die were on tile 6 and you wanted to travel back to tile 1, then you would move to something like (-500, 0, 0), which could be added to the current location vector if necessary.

1 Like

yes but that’s based on location and size of tile my BP would be enormous, i wanted to have the dice number add to the space number. so if the character is on tile 5 and rolls a 5 go to tile 10

Hi there,
You need to save two variables type integer: current tile and dice value, assuming only one dice is rolled. Then, your actor location is going to be set after every dice roll as: “get” current tile and “get” dice value, connect both variables to a “plus integer”, which output pin should be connected to “set” current tile.

So, next round starts and you roll the dice again, then repeat the logic of getting a new dice value.

wow thank you, i got it working and the dice add to the space that the character is on and everything, except the stupid Ai doesn’t want to turn at the end of the “Road” and continue onto the next grid spaces it only like to move forward

Glad to know you are progressing. If your road is linear without derived paths, you may want to try adding blocking volumes surrounding it. Else. You may need to make every tile a “tile actor”, so you can get its “world space” location. Then, call the function “AI Move to (actor or location)” and get the tile destination previously saved as actor or location variable.

Yeah I had a brain fart and forgot to put the nav mesh on the new tiles :person_facepalming:

1 Like

Hi, late to the party I know. I’m having trouble even figuring where to start to get a character to move according to a dice result (boardgame). I’ve been trying to figure it out with a spline. Is numbered tiles a better way to approach it?
Edit: It won’t be a square board, it’ll be more like Life or Fireball Island.