Rts how to add a construction time to buildings?
I'm working on an rts practice project and I'm pretty stuck on adding a construction time to my actors.
Right now I have a setup where the actors are bound to hud buttons, I click them they spawn in the world and follow your cursor, right click to cancel, some buttons mapped to rotation and they are transparent green if they can be placed and turn transparent red if they are on a slope or overlapping.
I'm trying to make it so when I click on the hud to spawn a building (this makes buildmode active) and then place in the world this will make the mesh transparent and have "x" amount of time and the building will be "built". I'd like to eventually have a resource requirement for the buildings and make it so a worker has to build it. And have it go through multiple build meshes depending on completion %.
But for right now I'd just like a set value for the build time that could be changed depending on the mesh and would work with my ingame time.
This is probably the most stuck I've been on this project since trying to learn ue4 so any help appreciated.
asked Nov 12 '18 at 06:46 PM in Using UE4
You can use the timer nodes for this. You can have the timer fire off a custom event (or bind it to an existing one) that will happen after the time you specify.
Additionaly, if you set the timer handle to a variable, you can interact with it as well.
answered Nov 12 '18 at 07:40 PM
I think that's a good solution, but I wondered if it could be done without using Event Tick. So I did this:
I think it should work... NOTE: SegmentNumber should be initialized as 0.
answered Nov 15 '18 at 05:13 PM
llll Sabre llll
Follow this question
Once you sign in you will be able to subscribe for any updates here