- Home /
how do i make this to a negative (ShopRespawn < 180)?
void Update() { shopRespawn -= Time.deltaTime;
if(Shop.transform.childCount < 1 && shopRespawn < 0){
}
if(Shop.transform.childCount = 1 && shopRespawn < 180) {
shopRespawn = shopStandard;
}
so i have shop respawn to count down and then if there isnt a shop already in place (it deletes after every 3 minutes) instantiate (havent put that bit in yet) anyway i dont know how to make it so once shopRespawn has counted down it resets and doesnt keep resetting do i do it outside of the update function or is there another way?
id like to make it so this bit of the code is negative shopRespawn < 180
I'm really not sure what the issue is here. Why can't you make it negative? That's what the '-' sign is for.
Just for starters, this line is probaby wrong:
if(Shop.transform.childCount = 1 && shopRespawn < 180) {
That first bit won't return a boolean like you expect- it should go like this:
if(Shop.transform.childCount == 1 && shopRespawn < 180) {
In any case, I really don't understand the question. You need to be more clear about what is going wrong, and what the desired behaviour is.
yes sorry hadnt had any sleep and was getting confused.i sorted the problem now and i did have a double equals sign must of accidentally deleted it or something thanks anyway