- Home /
This question was
closed Aug 21, 2020 at 01:01 AM by
Nokia4410.
How to have different variables in a script with different gameobjects using the same script
Hey, lets say i have two GameObjects that carry out the same actions, however in their script one has a faster speed than the other, how can i just change the variable of the speed in the script that is coming from a separate "Data" script like "playerData.gameObject1Speed", and "playerData.gameObject2Speed" rather than having to create an entire new script and just changing those variables in them.
Comment
Answer by AnkitRajpoot · Aug 15, 2020 at 10:03 AM
make a speed variable public then attach both of the game object then you can change there speed manually