1 (edited by apollo 2022-12-31 20:27:43)

Topic: Destroy Projectiles At The End Of Each Round

Hello,

How can I make sure projectiles are destroyed when the round ends so that it does not stay on the start of the next round and hurt the opponent?

I designed some projectiles to move slow and have a long duration. They are appearing at the start of the next round and hurting the opponent when they are idle and waiting for the new round to start fighting.

Share

Thumbs up Thumbs down

Re: Destroy Projectiles At The End Of Each Round

We probably need to add an option for that next update.
We could probably do it via code custom code but, want to make sure we don't cause a desync.

Share

Thumbs up Thumbs down

Re: Destroy Projectiles At The End Of Each Round

I bet in ProjectileMoveScript's update, you could have a check for if either of the players currently have no HP, and then set destroyMe to true. I believe that should work.

Share

Thumbs up Thumbs down

Re: Destroy Projectiles At The End Of Each Round

@Starcutter: Thank you, I got this work in ProjectileMoveScript.cs and I added this code in UFEFixedUpdate()
       
           

if(UFE.GetControlsScript(1).currentLifePoints == 0 || UFE.GetControlsScript(2).currentLifePoints == 0)
              {
                  destroyMe = true;
              }

Share

Thumbs up Thumbs down