Hi guys,
I have upgraded to Needle 3.47.0 from a far older version, 3.36 or there abouts. I am now getting an error accessing the transform of one of my objects and I dont know why. In the code below, I want to set the position of an object directly but it not longer works and gives me the error in the title of this post. The same occurs if I leave out the “.transform” and directly call “gameObject.position.set”.
What am I doing wrong here? Again, this has worked for months. The object isnt nul btw.
It is specifically this part giving the issue "
this.horseCameras[i].gameObject.transform.position.set
public focusOnRacerJS(index : number) {
this.broadcastCameraActive = false;
if (this.mainCamera != null && this.horseCameras != null) {
GameObject.setActive(this.mainCamera.gameObject, false);
//set the camera target to the racer
for (let i = 0; i < this.horseCameras.length; i++) {
if (i == index) {
GameObject.setActive(this.horseCameras[i].gameObject, true);
//reset the camera position
this.horseCameras[i].gameObject.transform.position.set(this.horseCamDefaultPosition.x, this.horseCamDefaultPosition.y, this.horseCamDefaultPosition.z);
} else {
GameObject.setActive(this.horseCameras[i].gameObject, false);
}
}
}
}