i need some help with this, i have a random.range var in a prefab, which acts as speed, but , all prefabs which contains this random.range var, all spawn with the same value, so random.range is not working or i dont know - how to spawn gameobjects , and make them have different moving speeds. this is basically my question , all my gameobjects move well , but i want some random speeds on them , just for the sake of variety if someone can help me please do, ive searched but havent found what i need, maybe its just wrong terms but its a little frustrating.
one thing strikes me. Most if not all speeds would be float dependant. So, make sure you are retrieving a float value, not an int. this is how it should work in code. Code (csharp): var minSpeed : float; var maxSpeed : float; var speed : float; speed = Random.Range(minSpeed, maxSped);
well just did this and it seems to be working bette.... i have 2 spawners, now with this tweak, the spawned ones from the spawn point B will move at the max speed and the ones from the spawnpoint A will move at the min speed. this is better, thnks a lot for this advice, i wll try to work around now . ty a lot EDIT: just fixed it , ummmm dont know why but the script in the editor was not updating , ( slaps face ) just hit reset and all changes appeared, man thank you a L O T , needed someone else's light here ujust made one puerto rican realy happy
One thing I would do is increase the range. Tough in all likely hood it is a total fluke, I have noticed random range patterns that are not very random, at first. 1,1,1,1,2,2,2,3,1,... Sometimes the pattern is not complex. Increasing the range increases the chances for diversity.