i have characters then are spawned random and walking with a speed of 1.
i have a script that says when it collides change the animation to run and i want the speed to change to 3.
i can successfully change the speed of the initial script but the problem is that it changes the speed of ALL the other walking models that share the script.
in my situation i cant make a script for each one because there may be multiple versions of the character in the scene at a time.
how can i make it just change the speed of the 1 character?
I think that you are accidentally accessing all of the scripts when the collision happens, are these scripts attached to all of the characters (I know the one that moves the character is)
When a variable is “static”, that means only one copy exists for every instance of that object.
Your speed variable is static, so every character uses the same speed, and if you change it, they don’t create their own copy. Just remove static and you should be fine.