Hey all making a simple rts/city building project for practice. I’m super stuck on adding a function to have construction time on buildings. I have some hud setup where I click an onscreen button and a mesh will follow my cursor and I can place it into the world, but what I want is when I place it, it will be slightly see through and over x amount of time It will build.
Not an animation, just the material will go from being see through to visible, got my materials setup already but I’m having trouble implementing an editable build time.
Final build would hopefully be a full animation with a unit actually building it but for now just trying to get my mvp setup rn.
I won’t really be able to test this until late tonight but would this be able to have different “time” values? Cause I have a custom in game time, day is 15 minutes. And would this eventually be workable with ai and such?
for your basic setup you could easily use a timline and a scalar parameter in your material. the scalar param would control opacity and the timline would set the parameter value. its a pretty basic script show below.
also not sure if itll help but in classic rts fashion i made a little script to switch a mesh based on build completion. never worked on something like this so it was a fun little idea to explore a bit.
This is also extremely useful so thanks. My main issue is I cannot figure out how to get my current setup working. Cause rn I’m following a youtube tut and the guy adds a mechanic for speeding/slowing the game down so all the code after isn’t gonna work for me since I don’t want that.
The tutorials In question if you or anyone else is curious
do you know the time at which the issue your having is? the links you provided are a hour long and are part of a 56 part series. so itll probably be difficult to go through the entire thing to figure out what issue your having. you also never actually show what your currently working on so how are we to know if its different than in the video.
Sorry sorry, I posted those so you could have a basic idea of whats going on.
Basically in the speed video I skip everything relating to game speed and slightly follow along with the rotate buildings part, I changed that code slightly but not enough to effect anything.
I then follow along in the next video but towards the end he starts to implement things that relate to the fact the game speed can change and that’s where my problem lies I believe.
28:37 of the second video is where I stop because I don’t have the functions he has. For all intents and purposes my code is functionally the same except there’s no time manipulation.
with how your picking little pieces of the videos theres not much point in us trying to work form that since it will not be an accurate representation of your current situation. we need to see your script to see how to fix the issues. if you want the result the tutorial gives then work from that if you want your own system thats cool too, but we cant help you build your own system when you only provide the tutorial. its like saying heres a blueprint for a house but i didnt follow it when building. makes no sense right.