# How to make that traks are randomly chosen each time the player plays an online game

**URL:** <https://forums.unrealengine.com/t/how-to-make-that-traks-are-randomly-chosen-each-time-the-player-plays-an-online-game/439789>\
**Category:** Mobile\
**Tags:** random, car, unreal-engine, Android, track, question\
**Created:** [December 19, 2018, 12:40pm UTC](https://forums.unrealengine.com/t/how-to-make-that-traks-are-randomly-chosen-each-time-the-player-plays-an-online-game/439789 "2018-12-19T12:40:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_e854e44f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e854e44f1](https://forums.unrealengine.com/u/anonymous_user_e854e44f1)\
**Post date:** [December 19, 2018, 12:40pm UTC](https://forums.unrealengine.com/t/how-to-make-that-traks-are-randomly-chosen-each-time-the-player-plays-an-online-game/439789/1 "2018-12-19T12:40:13Z")

</div>

I am creating an online car racing game and I would like to know how to make that tracks are randomly chosen each time the player plays an online game  
its an android game

---

<div class="post-metadata">

**Author:** ![Lupix](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lupix/32/593417_2.png) [@Lupix](https://forums.unrealengine.com/u/Lupix)\
**Post date:** [December 19, 2018, 12:44pm UTC](https://forums.unrealengine.com/t/how-to-make-that-traks-are-randomly-chosen-each-time-the-player-plays-an-online-game/439789/2 "2018-12-19T12:44:20Z")

</div>

In short, you would have to make an array in GameState perhaps, where you would have the available music tracks in.  
When the game starts, you would pick a random index from the music track array in GameState. When the currently playing music ends, you would repeat this (pick another random music track from that array).  
I suggest you put the playing music in an AudioComponent so you can adjust volume, add events when the music ends (so that you can switch to another random music).

Feel free to ask more specific questions if you need to.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e854e44f1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e854e44f1](https://forums.unrealengine.com/u/anonymous_user_e854e44f1)\
**Post date:** [December 19, 2018, 6:06pm UTC](https://forums.unrealengine.com/t/how-to-make-that-traks-are-randomly-chosen-each-time-the-player-plays-an-online-game/439789/3 "2018-12-19T18:06:09Z")

</div>

I’m really sorry to be so stupid but I was talking about the game level race track not a sound track  
I’m really sorry that you had bothered to write this text  
but I have another question that takes the same principle

I would like to put forward a system  
who does lottery kind the same concept  
the player looks at an ad then he will have a lot and each lot has a probability example:  
a car will have a 3% chance of being recovered  
and lots will have more chance like 55% or 65%  
I want also that the player have 20 tests a day and when the player plays them all  
the lottery will be closed until the next 24 hours  
also that the player has the jackpot the lottery is over for him  
I know my questions are crazy but  
nothing ventured, nothing gained  
If you don t know how to answer my question, you can postpone it for me.  
if not,i ve posted another question:

> **[How find a multiplayer match with differentes classes of cars (read the...](https://forums.unrealengine.com/questions/859076/how-find-a-multiplayer-match-with-differentes-clas.html)**
>
> so if you did not know it i’m trying to create a multiplayer car racing game where there are all kinds of cars (sedan supercars hypercars suv crossrover) plus it’s a multiplayer game i know what i’m going to ask you is crazy and it will take a video...

and i m creating an android game
