I'm making an enemy in my game. He stands at the side of road with a rocket launcher and fires when you get close. It nearly all works fine, except I just need a reference to the players position so that I can make his rocket explode when it reaches the same height on the map as the player car.  The enemy is a prefab which is NOT instanced at build-time, there a several spawn-points all with n% chance of spawning a guy there using the prefab. The player IS instanced at build-time. And here is my problem..  Although I have put a "public GameObject player" into my variables in the script on the prefab, it doesnt let me drag the already instanced player into it. I've read about a bit, and I see that Unity will not allow this (or at least thats what I gathered!)  So after much searching I came up with   player = GameObject.FindGameObjectWithTag("Player");   But i havent even tested yet because the source where i got that advice in the very next comment the guy says I shouldnt do this because it takes too much system resources up.  EDIT: I have tested it with that line, it does work. But is there a better way  But he doesnt say the way that it should be done! And the thread is about 6 years old. So I thought I'd write here again and ask you fine folks for more help.  I hope I explained the problem clearly enough, I think i got the terminology right. Basically, the RocketerEnemy prefab is going to be instantiated in runtime, but the PlayerCar is already instantiated by my dragging it into the heirarchy at the beginning of the project. This is stopping me from dragging the PlayerCar object into the box in the Inspector (for the Enemy prefab) . All I really need is the PlayerCar.transform.position.Y value for each frame.  THANKS IN ADVANCE !
I'm creating a game where I have an Entity class that contains basic entity info (pos, health,..) and some functions. Enemies and Player later on inherit from this class.   Public class Entity {  public Vector2 position; public float health; ,...   Lets say that I have a function like this inside the Entity class:  public GameObject movingIntoEnemy(Vector2 movingToPoint) {     foreach (GameObject go in GameObject.Find("GameMap").GetComponent&lt;GameMap&gt;().enemyList)     {         if (go.GetComponent&lt;EnemyScript&gt;().enemy.position == movingToPoint)         {             return go;         }     }     return null; }   This function looks for a GameObject called "GameMap" and then cycles through enemies in it's list. If an enemy is found, it returns it's GameObject. Using GameObject.Find() is pretty ineffective, so what would be a better approach to this? I mean, I can't just easily use  public GameObject GameMap;   since the code is in a class, and this class needs to be instantiated first in my player/enemy scripts.  My question is - how do I attach gameObjects to this class before it is even created? What is the appropriate approach to this? I guess that I might pass these GameObjects to the class through it's constructor, but it would make things much more complicated.   Thanks in advance ;)
What does "Incompatible types: void cannot be converted to ..." mean? "Its" as a Possessive Pronoun Since its can be both determiner possessive pronoun and nominal possessive pronoun, an example of its as determiner possessive pronoun would be:     We saved this question for last because of its complexity.   Because complexity is a noun, so its must be a determiner possessive pronoun in this sentence. I'm looking for an example where its is used as nominal possessive pronoun in a sentence as above. What factors determine enemy levels or: How do enemy levels scale to the player character's? ASP.NET MVC Custom Error Handling Application_Error Global.asax? Why does a translation matrix need extra row? Is $(x^2+y^2+z^2) \ \sin \frac{1}{\sqrt{x^2+y^2+z^2}}$ Differentiable in $(0,0,0)$? $$f(x,y,z)=\begin{cases} (x^2+y^2+z^2) \ \sin \frac{1}{\sqrt{x^2+y^2+z^2}} \qquad (x,y,z) \ne (0,0,0) \\ \\ 0 \qquad (x,y,z)=(0,0,0) \end{cases} $$   At first, I study the continuity in the origin.  I apply the concept of sequential continuity: $x_n \rightarrow x_0 \Rightarrow f(x_n) \rightarrow f(x_0)$   So, $x_n=\frac{1}{n}  $ $$x_n \rightarrow 0 \Rightarrow f(x_n,x_n,x_n) \rightarrow f(0,0,0)=0$$ $$\lim_{n\rightarrow +\infty} \frac{3}{n^2} \ \sin \frac{1}{\frac{\sqrt{3}}{n}}=0 $$  How can I continue the study of differentiation?  Thanks! Someone asked a very similar question in regards to window recovery for windows xp:   I'm using windows 8 (or 8.1 now). I run Dual Monitors. On Monitor 2 I sometimes have the input switched to something else other than the windows display (Mac or PS3). If there was a program that was displaying on Window #2 that does not have 'move' where I could potentially alt-space-m arrow keys. Is there another way to get that program to display on Window #1?  I tried right click on the program and doesn't seem to be anything there. I tried Windows Key and Arrows. I Tried right click toolbar and cascade.  I'm hoping this is a DUP or Softball question because this annoys the crap out of me.  Thanks!! Computing the Galois group of $x^4+ax^2+b \in \mathbb{Q}[x] $ I want to compute the Galois group of some polynomials, but I want to see some examples first. For example this proposition could be helpful. I don't know how to prove it &lt;.&lt;  Let's consider a polynomial $f(x)= x^4+ax^2+b \in \mathbb{Z} $. Let $ \pm\alpha , \pm\beta$ denote the roots of $f(x)$. Note that $f$ is irreducible iff $\alpha^2, \alpha\pm\beta \notin \mathbb{Q}$. So let's suppose that $f(x)$ is irreducible. Let's denote $G$ the galois group of $f$ (the Galois group of the splitting field $\mathbb{Q}(\alpha,\beta)/\mathbb{Q}$)  $i)$ $G\cong V$ the Klein 4-group iff $\alpha\beta \in \mathbb{Q}$  $ii)$ $G\cong \mathbb{Z}_4$ iff $\mathbb{Q}(\alpha\beta)=\mathbb{Q}(\alpha^2)$  $iii)$ $G\cong D_8$ the dihedral group of order 8, iff $\alpha\beta \notin \mathbb{Q}(\alpha^2)$  I need help with the proofs of this propositions... Well I'm very lost with the computation of Galois group, some care must be exercised, I don't have it. For example I know that Galois group acts transitively, in the sense that $u\in K/F$ a galois extension, the other roots of the minimal polynomial of $m_u(x)\in F[x]$ are precisely the elements $ \sigma(u)$ , where $\sigma \in Gal(K/F)$. And clearly any automorphism, is determined by only the value of a basis. In this case we are working on $\mathbb{Q}(\alpha,\beta)$, so I have to know the values of both. But I have to respect the algebraic relations involving $\alpha , \beta$ I proved that in $i),ii)$ $\mathbb{Q}(\alpha,\beta) = \mathbb{Q}(\alpha) $ So I have to know the values on $\alpha$.   My first question is: If in both cases $i),ii)$, I have an extension of degree 4 (so $|G|=4$) I have to map $\alpha$ to determine the automorphism, but I have also to map $\alpha$ to all of it's four roots. Why the galois group in this case are different?  My second question is about $iii)$ I have no idea How to attack it. Why exactly can't a single resistor be used for many parallel LEDs? Why can't you use a single resistor for a number of LEDs in parallel instead of one each? Block network access of a process? Is it possible to block the (outgoing) network access of a single process? How to show zero before decimal point in bc? echo "scale=3;1/8" | bc   shows .125 on the screen. How to show 0.125 if the output result is less than one? How do you make div elements display inline? Bootstrap Paradox in Interstellar Is there a way to monitor an SSD state and predict its failure in case of active read-write usage? As far as I know, the only con against switching to an SSD except its price is the tendency to fail soon (relatively to conventional HDDs) in case used in active read-write operation. Is there an efficient way to predict the failure? The basic 6T structure used for storing data is same as one used in "Positive Feedback Differential Voltage Sense Amplifier", then how come while the data is stored in SRAM memory cell it doesn't get amplified? Better way of saying "those who are curious"? how to scale math font only I often see questions on Stack Exchange sites which I presume are written by non-native English speakers who use the word "doubt" in place of the word "question". Is this a case of misunderstanding the correct meaning or are people being taught that this is correct usage? UV mapping not filling faces I have tried to map this simple object, but the uv mapping does not correspond to what i see in the textured object. It cuts the image a bit on top and a bit on the bottom of the faces. It does not fill the faces with the texture, even though i have mapped them correctly. Does anyone know what could be happening? Thanks in advance. First, I'd like to apologize for the awkwardly-phrased title.   Instead of trying to explain the structure I'm thinking of, I'd like to give some context and then an example or two. I've used and seen this construction used conversationally, and if my memory and intuition serve, conversationally only. I'm curious to know if there is a formal term for it.  Ex 1  "If you don't like what I'm offering, the door is that way."  A purely logical interpretation would make little sense with this example. In this context, the inference is that the speaker is indicating to whomever he is speaking that they should leave, which suggests that there might be an elision, e.g.  "If you don't like what I'm offering, ... [then you may leave. T]...he door is that way."  Ex 2  "If you're hungry, I have food."  This is a similar context. The implication is that the speaker will offer food to whom she is speaking if they are hungry. A (strictly) logical interpretation would, again, make little sense (if you are hungry, then I have food doesn't convey any intent to provide it, nor does it make sense; the speaker always has food, she just will offer it if her guest is hungry).  I recognize that this might be too specific to have a term associated with it. I'm just curious to know what it is if it does exist.