Getting instance from other scripts

Hey everyone, i run a little issue that i’d love you to help me solve it out.
I Have an instance and all parameters ID and information on one script, i would like to access it and getting the script component so i’ll have all the instance information on another script.
basically i have my player script that i want to affect parameters that are placed in another script.
I Was thinking on getting the component but im not sure how it should be done properly.
thank you.
Gal

Hi Gal, to get the player component from another component attached to the same GameObject you would use GetComponent<Player>(), or replace “Player” with the actual type name of the component.
For passing the information you would just need to create public getter methods for those parameters in Player. Did that cover what you were asking?

1 Like