Hey guys!
I’m trying to access a function of a script from another script.
My first script EnterVehicle.cs calls the SetTarget function of FollowCamera.cs like this:
mainCamera.GetComponent<FollowCamera>().SetTarget(enteredCar);
SetTarget is declared as follows:
public void SetTarget(Transform _target)
{
target = _target;
}
Unity keeps crashing when I call SetTarget from my EnterVehicle script.
Unity has been really unstable since I updated: I don’t get any runtime errors unity just freezes and I have to close it from the task manager.
Has anybody got an idea what I’m doing wrong?
Thanks in advance,
Cranberry