Random number changes what location player moves to.

I am making a board game we like to play in my family into a video game and I can’t figure out how to move the player a certain amount of spaces (so to a certain location) depending on what the random number/dice roll is. I have the random number set up and that works i just need help with the certain location part.

First of all welcome to the forums :).
Your question is a bit unclear. I’ll try to help you. You need to calculate what is one amount of space, then multiply it by the amount you want to move.

There are two ways of moving your player once you know location. You can either teleport player there, or move it using transform lerp and mo player smoothly.

If locations are fixed, you can place markers on the map, and then read locations from the markers. Give integer ID for every marker, and then use math to determine distance between the two.

1 Like

I am super new to unreal engine and game development so i pretty much dont know how to do anything so if you could, could you explain how to place markers and get location and then what i have to do with blueprints in as much detail as possible because i have no clue what so ever when it comes to doing the blueprints (i did the random number from a tutorial).

if it is possible for more detail then it will help me a lot more and thank you.

As much as I would like to do that, I am quite sure that’s not possible. I strongly recommend you search for some tutorials on YouTube.

I will try, but I’m quite sure you will have to learn a lot from other tutorials.
If your “map” is a board. Create actor that represents one space (field). Place that actor in every field. Create custom game state (if you’re gonna make an online game). In game state, make an map of key integer, value FVector - Location.

Whenever marker actor joins game, add it’s ID (as key) and location to the game state map.

Now, your character has also access to game state where it can read all locations. You know your char location, and if you want to move it forward, just do the calculations using ID’s. Unfortunately I can’t go a bit more in to details about this. You will have to learn Unreal in general, in order to make this work.

1 Like

ok thank you