Scene reset
afula86
Member, PRO Posts: 9
Hi guys,
I have a background music in my game. I'ts a target shoot game. after every shoot I reset the scene, so the ball and the other actors go back to their original position before the next shoot. The problem is, that the background music is being reset too. Does anyone has an idea how do I reset the scene withoug reseting the music?
Thanks!
Comments
I wouldn't reset the scene, just reset the attributes its faster and better imo.
In our Blast template we do this by resetting the attributes back to default, things like positions rotations etc.
The mine actor has 2 self attributes StartX StartY and i change these to the mines self.position.x & y at the top of the rules then when you fail or reset the mine changes its X & Y position based on these attributes.
Darren.
Thanks, but it's not quite simple, because I can't restore the camera tracking area, only the scene reset can...
Maybe another idea?
You can try to destroy all actors and spawn all the actors again in the same positions, make a game boolean attribute :"destroyactors", when shoot overlay or collide with enemy game.destroyactors to true, and in the enemy actors if game.destroyactors is true , destroy actor and spawn actor.
and in the actor hero when gamedestroyactor is true, destroy and spawn actor.
and in the shoot actor when overlap or collide with enemy destroy actor.
When you say you can't restore the camera tracking area, you can go into an unlocked actor and access the camera.
Darren.
Thanks DeepBlueApps, I didn't know that and it helped a lot!
Brilliant glad I could help, best of luck with your game.
Darren.