Skip to content

modifying script variables from another script #1389

Discussion options

You must be logged in to vote

A script can modify a public field/property of another script. If they are on the same entity you can use Entity.Get<OtherScriptClass>() to obtain a reference to the other script. If they are on different entities, then you should create a field/property public OtherScriptClass {get;set;} and assign it via the editor by draggin over it an entity with the other script.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JustAnotherGameDevWasTaken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants