Reading Input from a Different Script - Help!

Hello all,

Are you able to read input from another script’s input readings? Say I put a script on a separate object from my game controller, and I want it to move to the character when I hit a key. Can I read this from the other object’s script?

Thanks!

You would have to make a public variable then keep track of it in the game controller then access it with something like this:

var myVar=GameObject.Find("GameController").GetComponent("ScriptName").lookAtVar;