Each character has a script and within the script a "speed" variable.
I have an empty GameObject with a script that will handle all the combat mechanics. This script accesses the speed value of every character. It also has these values in an array.
How do I script to have the Assign the turns based on speed? For example, 100speedChar goes before 70speedChar who goes before 50speedChar etc.
Flip the speeds, so that lower is better, with, say, 100/spd. That gives your speed 100 a 1 and speed 50 a 2. Call that the "ActionDelay."
Start everyone off at their ActionDelay. Each turn, lowest number acts, and add their actionDelay:
answered Nov 20 '11 at 03:36 AM