Quick question for the forum, not asking for someone to write this code or anything but just wondering if someone could point me in the direction of where I could get a start on how to spawn enemies in a pattern like the ai in galaga?
Thanks
Quick question for the forum, not asking for someone to write this code or anything but just wondering if someone could point me in the direction of where I could get a start on how to spawn enemies in a pattern like the ai in galaga?
Thanks
This is probably not a conventional way, but just an idea. In your 3d program, you could make a file with joints representing the positions. One 3d file for each type of formation. These files probably shouldn’t be too big. You could name the joints different ways to signify different types of ships.
Let’s say you have ships a, b, and c.
Maybe name the joints formationJoint_a1, formationJoint_a2, formationJoint_b1, etc
Then in unity you could code something like this:
(note, very pseudocode and kind of pythonish - also don’t know the equivalent to a python dictionary in js… table?)
shipA : GameObject
shipB : GameObject
shipC : GameObject
shipDict = {'a' : shipA, 'b' : shipB, 'c' : shipC}
jntList = findAllGameObjectsStartingWith('formationJoint')
for every joint in jntList:
typeOfShip = joint.replace('formationJoint_', '')[0]
Instantiate(shipDict[typeOfShip], joint.transform.position, Quaternion.identity)
Thanks for the reply, I am looking at every possible angle on this but I am hitting a brick wall and what you have given me is a great start, my game is in 2d and I just need to fly in a certain pattern, I have looked at instantiating a certain pattern on the docs but trying to translate that into a wave formation. If that makes sense.