i am attempting to make a Tower Defense game similar to Plants vs Zombies and i want the enemys to spawn in a random lane every random amount of time. I am not sure what the "actor" would be in my situation, so does anybody know if it would be the spawn location that i have setup or would it be the enemy actor? and am i able to use this code to make this multiple lane thing happen?
what you'd do is make a blueprint that spawns in the zombies , then for their spawn location you make it choose between the positions of a handfull of empty actors (you can just create a blueprint and put nothing in it) . that way you can add those empty actors to an array, have it pick one at random and use the transform properties from that one to pick the spawn location for your zombie.
@@thegamedevcave Yeah so I have already made a blueprint that is set on a timer and when the timer goes off it triggers an event to then spawn the enemy and move him forward by the direction of an arrow. Being pretty new to game development, I am not sure where I put the empty actors that you told me to make. I made 5 of them as there are going to be 5 lanes for the enemies to go down but would I put those in the blueprint where I made it so that the enemies can spawn via timer and how can i put them in the blueprint? (The empty actors) Also just in general i'm not sure how I can make this code and then add it to the spawning event. Thank you for helping me though, this isn't really a priority so you can take your time on me. Just a little bit of a noob lol.
I am new to unreal so sorry if my question is dumm but where (in the details panel of which object) can I find the actor array to add new actors? In your Video its the objcet called example (self ) but how do i know how this object is called in my world? I would be very thankful for help. Thanks
the actor array is located on the blueprint in which you made it. so in this video i have a blueprint that movves objets along a spline as the example, the array will be visableon all the actors from that blueprint (assuming you've set the array to being public by enabling the eye icon)
After the cube completes 1 round of going around the spline does it switch automatically to another object? And keeps randomizing after that? Thats what I'm trying to achieve but not able to do so far :)
Sort of like an invisible conveyor belt that brings random objects from A to B, after one spline round is completed another random object is picked from the array and so on :)
this basic idea can be used for that, but instead of at begin play, you should put the nodes at the start of the "play timeline" event , that way it'll pick a random actor, play the timeline, and pick a random actor again. it only supports one actor per spline like this. there's some simple, less optimized ways around that though if you really need multiple items on your conveyor belt at the same time!
Thank you so much for answering my previious questions regarding this and now for this! Amazing thanks!!😆
Dude you are the MAN! Thanks. I would love to see you and J. Winbush collab on some greatness 🙌💯🤙
Hey, just a quick question. How do i make it more likely that one actor spawns over the other? Rn theres a 50/50 chance of either one being chosen.
Thank you, exactly what I needed to know. What a spaghetti mess I had before seeing this video, lol!
Nice vid man! 🔥🔥🔥🔥🍻
But what if I want a random Actor instead of an Acotr?
i am attempting to make a Tower Defense game similar to Plants vs Zombies and i want the enemys to spawn in a random lane every random amount of time. I am not sure what the "actor" would be in my situation, so does anybody know if it would be the spawn location that i have setup or would it be the enemy actor? and am i able to use this code to make this multiple lane thing happen?
what you'd do is make a blueprint that spawns in the zombies , then for their spawn location you make it choose between the positions of a handfull of empty actors (you can just create a blueprint and put nothing in it) . that way you can add those empty actors to an array, have it pick one at random and use the transform properties from that one to pick the spawn location for your zombie.
@@thegamedevcave Yeah so I have already made a blueprint that is set on a timer and when the timer goes off it triggers an event to then spawn the enemy and move him forward by the direction of an arrow. Being pretty new to game development, I am not sure where I put the empty actors that you told me to make. I made 5 of them as there are going to be 5 lanes for the enemies to go down but would I put those in the blueprint where I made it so that the enemies can spawn via timer and how can i put them in the blueprint? (The empty actors) Also just in general i'm not sure how I can make this code and then add it to the spawning event. Thank you for helping me though, this isn't really a priority so you can take your time on me. Just a little bit of a noob lol.
I am new to unreal so sorry if my question is dumm but where (in the details panel of which object) can I find the actor array to add new actors? In your Video its the objcet called example (self ) but how do i know how this object is called in my world? I would be very thankful for help. Thanks
the actor array is located on the blueprint in which you made it. so in this video i have a blueprint that movves objets along a spline as the example, the array will be visableon all the actors from that blueprint (assuming you've set the array to being public by enabling the eye icon)
After the cube completes 1 round of going around the spline does it switch automatically to another object? And keeps randomizing after that? Thats what I'm trying to achieve but not able to do so far :)
Sort of like an invisible conveyor belt that brings random objects from A to B, after one spline round is completed another random object is picked from the array and so on :)
this basic idea can be used for that, but instead of at begin play, you should put the nodes at the start of the "play timeline" event , that way it'll pick a random actor, play the timeline, and pick a random actor again. it only supports one actor per spline like this. there's some simple, less optimized ways around that though if you really need multiple items on your conveyor belt at the same time!
Ah got it! Thanks a lot man really appreciate the help, I'm still a complete noob when it comes to Unreal! Thank you so much!😊