- Home /
Referencing an object from one script to another, script reference doesn't help :/
Okay, so I'm making a FPS controller, and I know there is already one but I'm doing this for the experience, beside the fact I don't like the so-called "JavaScript" that comes with unity. I'm making a deceleration module, and the camera to rotate and the model to rotate with it, however that leaves the issue that the camera is the child and not the parent. If I make the camera the parent I can fly around, and I don't want to change position per-frame, I'd rather change rotation. I have the mathematics behind it figured out (current rotation - previous frame rotation if greater than 0, if smaller than 0 current rotation + previous rotation), so I know what I want from it. I don't want to change the variable, I just want to read it's value. An opt to overhaul the current system is an option, but eh; I won't learn much from it.
There's no real point including the script in my opinion, but if you want it ask for it.
This is in c#, and I'm not up for a language change. Thank-you very much.
Are you asking how to read a value from the transform of an object's parent? The value from another control of an object's parent? The value from a child?