- Home /
Problem is not reproducible or outdated
How to make variables change for only one item having the script
Hello, i have multiple objects that have the same script attached. It gives all objects a specific amount of current HP and maximum HP.
I stored it in public variables because i have to access it from my player.
The problem is, when one object loses HP, all the objects having the script lose hp...
How can i solve this problem?
Update: figured out that it was impossible to do it the way i wrote it. Just followed some HP on ennemies script to do what i wanted.
Can you provide the script managing the HP? (please, edit the question to add the script using the 101010 button) Do you have any static function / variable ?
Follow this Question
Related Questions
C# taking variable from other script 2 Answers
How to access value within instantiated class in different object? 1 Answer
VR visualisation of several thousand GameObjects 1 Answer
How to create a variable in which I can put scripts 2 Answers
How do I assign a variable the proper sprite in the script? (C#) 1 Answer