Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Think of the system like being from subway surfers Except I have 10 premade pieces and it just randomly lays it out |
||||
|
First, import all your 10 track_obj pieces into the scene and set their position to 0,-1000,0 (to move them out of the way). Now place an empty node where you want the track-pieces to appear in the game (to make it easier). Then use the following method to select a random track-piece and move it into the game... Before First Draw (and on reload): Set Variable: "Track" =0 //* (note that random integer needs to be set between "1 to 11" - so it will generate numbers between 1 and 10) Every Few Seconds (2000ms), Set random value "Track" (Between 1 and 11), Every Few Seconds (2000ms) If Variable "Track" =1, Change Position of node: "Track1_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =2, Change Position of node: "Track2_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =3, Change Position of node: "Track3_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =4, Change Position of node: "Track4_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =5, Change Position of node: "Track5_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =6, Change Position of node: "Track6_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =7, Change Position of node: "Track7_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =8, Change Position of node: "Track8_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =9, Change Position of node: "Track9_obj" Relative to: "track_marker_node". Every Few Seconds (2000ms) If Variable "Track" =10, Change Position of node: "Track10_obj" Relative to: "track_marker_node". *You can either use the same "Every Few Seconds" behaviour for all your actions, or you can use a separate "Every Few Seconds" behaviour for each action. Both methods will work, I chose separate behaviours in this example to make it easier to understand (and quicker for you to copy/paste if you try it). What should happen is: every 2 seconds, the track will change randomly between your ten pieces... Depending on how you want your game to be, there are several methods you can then use, to move either the track/train/camera to make the train/track move along and make an endless-runner type game. |
|