Is Private PlayerController a thing?
My teacher gave me some code for a turret script and i'm having issues with this line of code
private PlayerController playerScript;
it says PlayerController does not exist. There is something called charactercontroller will that work?
Thank you in advance to anyone that helps. p.s It's in C# script :)
Answer by simranvaidya99 · Jul 10, 2020 at 11:50 AM
private PlayerController playerScript;
here, the PlayerController is nothing but the name of the other c# script you are referring to. make sure you give the same name as that of what you gave to your other script. With this, you can refer to the variables from other scripts.
About playerScript, you can give any name as it is a variable name. Hope this helps.
Your answer
![](https://koobas.hobune.stream/wayback/20220612143223im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Lerp problem when target is behind turret 0 Answers
Get rotation of a randomly rotating turret on a moving tank (to Spawn missiles in that direction) 2 Answers
Rotate tank turret using quaternions 0 Answers
how do I make a connon ball turret script 0 Answers
turret not facing correct rotation 3 Answers