- Home /
[Shooting shots Scripting] How to make the compiler know that I mean the empty quad by the Public Transform?
unity 5.3.5 in shooting shots, there is public Transform shotSpawn
and in void Update (){ shotSpawn = Instantiate (shot, shotSpawn.position, shotSpawn.rotation); }
there is the code inside, My question is how did the compiler know that I meant the empty GameObject "Quad" ? Because the code doesn't make the ship shoot shots, when I was thinking. I'm confused about how can I make unity know that I mean the Quad by that public Transform shotSpawn
Question is unclear.
What do you want to accomplish, and what doesn't work in your current code?
If you want to instantiate a quad, create it, make a prefab out of it, create a public GameObject in your script, drag the prefab there, and instantiate it.
Your answer
Follow this Question
Related Questions
The spaceship acceleration script is good ? And how to use it with engine ? 0 Answers
Attach to other coordinat SpringJoint2D from code. 0 Answers
Why when using LookAt to make the turret facing the target it's facing the other direction ? 1 Answer
Why when creating new animator controller for the character the character is not walking right ? 0 Answers