function Update ()
{
transform.Find("object").GetComponent(Object_rotate).turnSpeed = 100;
}
This is calling my GameObject, called “object”.
Hierarchy like this,
- Slider - script one.
- Object_slide
- object - Object_rotate.js
And it is trying to call,
var turnSpeed = 0;
function Update () {
sPin = Time.deltaTime * turnSpeed;
transform.Rotate(Vector3.up * sPin);
}
system
3
try using GameObject.Find()
And whats the problem with this? Doesnt it work? any errors?
Well first you shouldnt call your objects, objects.. this may confuse the system.
Second: you should save your result in a variable and then access to it