Hello, I am making a game, and I want to make an object create a chunk of wood that falls, when that wood is destroyed it will create another one. How do I go about doing this?
Develop games in your browser. Powerful, performant & highly capable.
On the object you can use the spawn action to spawn a chunk of wood. You can give it physics behaviour so it falls or set it to a bullet at angle 90 so it move downwards. You then destroy the wood by whatever event you are using, hitting the floor or something. Then use the event trigger On chunk of wood destroyed > spawn chunk of wood on object.
— First, thank you, second, I know that much, but I have multiple wood spawners, how do I make a wood spawner associate with the wood it created?
Oh, and I just realized that my last post might have come across as rude. Sorry.
Oi, talvez o objeto particulas te ajude... se for pra criar fragmentos de madeira...
Usually I would give the wood spawner an instance variable, a kind of ID, so the first one var is 1, second one, var is 2 etc which you can pull from the wood spawner's own IID (instant of that object type). Then any wood spawned from it, you can set an instance variable on the wood to match the spawner. So something like spawner - spawn the wood. Wood set wood.variable=spawner.variable. Then any wood marked as 1 has come from spawner 1, marked as 2 from spawner 2 etc.
Thank you! Also
— Estarei usando partículas. Obrigado. Isso foi o Google traduzido
Alright. Please help! https://drive.google.com/open?id=0B-OzP ... 3QySVNvbGs
Not sure what your trigger event is meant to be for spawning wood so I set it to every 2 seconds. This is the logic for matching wood to its own dispenser. https://www.dropbox.com/s/ytkppgcc6b0hf ... .capx?dl=0
My trigger is when it is destroyed if that helps and thanks
How would I make it so that when a piece of wood is destroyed it triggers the wood dispenser that created it, but none of the other ones?
I sorted it here https://www.dropbox.com/s/ytkppgcc6b0hf ... .capx?dl=0
Added a wood total for the dispenser. It's +1 when wood created, subtracts 1 when wood destroyed, then creates more wood if total is 0.
— Thank you a ton! It works perfectly.
Np, I'm happy with my logic there. All wood relates to its own dispenser and wood will be dispensed from it when no wood remains!
Once more, thank you, you were super helpful.