Hi, I have a problem spawning coins when an enemy dies. What I did was. I created an object going from left to right and right to left and spawning bullets falling on the floor. Just like space invader, or Galaxian kind of. When the bullet hits the ground it is destroyed by the floor So floor is set to kill enemies. What I want is I want the bullets to spawn a coin when it is destroyed. How that is possible. I created a coin action. I even added that action inside the death of spawned bullet. Still doesn't work. Another thing I did was I even spawned another enemy so when it is destroyed it created a coin action to be picked up. What happens in the both situations above the coin keeps on falling down. I am sure there must be an easy way to do this but seems I can not solve it. I would really appreciate if anyone can help in this situation.
I think the only way to do this is by hiding the coin behind the enemy. Not sure if it disappears when the enemy dies and it is connected to it. You have to try.
Yeah I trid it spawns the action also with the bullet but now it is destroyed when the bullet is destroyed.I also copied and pasted the action inside the defeated animation. (Like your tutorial which you earn points when you kill an enemy) but now the action keeps on falling down like there is no collision on the floor.
Have you tried this method ? https://www.buildbox.com/forum/index.php?threads/reward-coins-points-for-killing-enemies-bbdoc.5697/ But ofc make the coin smaller to see it instead of just collect it
Yes tried and it seems really buggy. Now I am on to something new and having more buggies on that! Thanks
What I was able to do was this: The bullet has a death animation an OBJECT (enemy, with damage 0, Spawn Rate: 99999). So when the bullet hits the ground(character bullet with 999 life) the bullet will be destroyed and will let the object static in it's place. Now when the character (who has damage 1) touches the object it will automatically destroy it. And the coin is in the death animation of the spawned object Hopefully you understand if not i can send you the project. Currently i get +2 coins per bullet don't know why
Well that's just if you want the player to see and pick the coin up. There is no need to make its opacity 0. You put the coin in the death animation of the bullet and make it big enough so the character takes it automatically
I've played a bit with it and sometimes it takes 1 and sometimes 2 if i make the action big enough. If i activate Debug Mode i can see that the spawner in the bullet creates some sort of collision box and i think that is the problem
yep its creating 2 collision boxes and 2 coins. Good catch by the way! I wrote support and its been solved there are no longer duplicates.
Hi I have done your way for my scoring purposes and actually didn't have good luck when tried for coins. But will try your way. By the way when I did for scoring I had the same problem. The way I chose it have set the action duration to 2 and the spawned action animation frames to 50. I guess scoring twice has got to do with how long that action stays on screen. Try to play with Action duration alone and the frame count of the spawned action. You do this inside the defeated animation where you paste the action.
@volcank When you scale the coin up in the Defeated Animation to cover the player when activated and you have the animation frames set to a number say 90 it will stay there for that long. If you change the frames to 1 then when the coin is activated it will disappear immediately. I also noticed the same thing if the coin is there for example the 90 frames the character (player) will be in contact with it for that long and then the score increases (1,2,3..) for that duration. I haven't had luck with the action Duration using the copy paste method. I posted in the Feature request part of the forums for Objects to Use actions: https://www.buildbox.com/forum/index.php?threads/objects-use-actions.8769/ +1 if you would like this? To me its getting old always hacking this and that to get something to work. I like the fact that the frames are in the Defeated Animation slot so that I can replace what was killed for a certain amount of time, in one game I had it set to like 500 frames because I wanted to keep it on screen (not a coin of course, but eye candy).
Thank you I also liked your other thread. I think it is a brilliant idea. Thank you for that. It's a shame that BB is so easy to use but we try to do other easy features with some other tricks. LOL. I mean some things in other game engines are so easy to do. I hope things will change through time.
Cool Works Great! I really wonder if we can also spawn another enemy that we killed. So when we kill one another appears with the same properties. And even maybe 2 of them are spawned. I am planning to make a shooter which when the enemy is killed another harder one is spawned.