0
Turret. How i can do it?
People, all sprites call the letters of the alphabet, how to make a damn turret, what would the sprite b spawn sprite c that flies into the sprite v, forgive me if the question is stupid. Unity
1 Answer
0
I assume that you mean a stationary, occasionally shooting object. The object obviously needs to rotate, so that it faces the player when shooting. I don't know how exactly to do this, but I think you can use ray casts.
Then you have to use a timer if you want it to shoot at a consistent pace or implement another system if you want it to shoot at random intervals. You need one Prefab as the bullet/projectile of your turret.
You can instantiate it using the Instantiate function, and rotate it, so that it faces the same way as your turret does.
I unfortunately do not have any code to share, but I hope I could be of help.