// -- Amended Question --
C# example :
My js workaround :
Any help or info would be greatly appreciated.
// Thanks , Jay.
// ---- First Posted Question ----
From what I understand that I am trying to do, is establish a set of vars to live in a 'class' , then I should create an instance of this class, for other scripts to access vars or adjust vars.
In my previous projects, to read/edit other scripts' data I have simply assigned a e.g. var myTPC : ScriptTPC; and used GetComponent in the Start to load the script.
So before I start; can someone please help me understand what is being set up in this C# script :
Many thanks, I am self-taught so alot of the terminology is lost on me.
3D Buzz link : http://www.3dbuzz.com/vbforum/content.php?212
Scroll down to -> Section 2 ; Video 6 - TP_Controller Skeleton
Edit 1 : I understand I have to load CharacterController , and this actually loads preset functions I can call on (TransformDirection , Move, IsGrounded etc) , I don't understand how to create an 'Instance' that all scripts can call on. My method would be to load the other scripts into a var then edit e.g. var myTPC : ScriptTPC; myTPC.posX = 1; (would change the posX var on ScriptTPC to 1). Can I just do this instead of creating an Instance?
Edit 2 : So far my scripts are working , using a different method of reading and writing to each other. Although I do get a Warning : BCW0028: WARNING: Implicit downcast :
and I'll have to do the same for the TP_Camera script
Answered on this Question :
answered Apr 06 '12 at 02:10 AM
answered Apr 04 '12 at 09:17 AM