[HELP] Smoke not appearing

Ok so ive followed what has been said to do to make the particle system appear - ie the smoke when you break the blocks - so when i follow the instructions for this code the bricks stop breaking and when ive tried moving where the smoke s instantiated the bricks break but no smoke appears…any ideas?

Hello Blake, how are you? Can you share an picture showing both the hierarchy and the brick inspector?
Could you also paste the code that create the smoke and that destroy the brick?

1 Like

void HandleHits (){
timesHit = timesHit + 1;
//another way to write the times hit is timesHit++;

		int maxHits = hitSprites.Length + 1;

		if (timesHit >= maxHits){
			breakableCount = breakableCount - 1;
			AudioSource.PlayClipAtPoint (smash, transform.position);
			levelManager.BrickDestroyed ();
			Instantiate (smoke, gameObject.transform.position, Quaternion.identity);
			Destroy (gameObject);
} 		else {

Hey Blake,

Have you dragged the smoke prefab from your Assets folder to the exposed Smoke variable on the Brick prefabs?

e.g. if you select a Brick prefab (1, 2 or 3 hit), does it reference Smoke or does it say None.

It will need to be set for all of them.

I note that you have a Smoke prefab in the Hierarchy, but from what I recall this was just one that you had dragged and dropped directly into the scene (doesn’t need to be there).

1 Like

hey rob

yerrr i had the smoke variable exposed and attached…and i tried removing the smoke in the heirachy coz joao mentioned the heiarchy and i went back through the video and looked and it wasnt there…BUT man…something had gone way screwy with my game…since doing this…just in the last few minutes…so…what was happening last night was id add that line of code in and the bricks would crack but not break…or theyd break and no smoke would come
Now ive done as you said and man…kinematics got turned on all of my bricks…so i was like AH this why they arent breaking…so i turn it off and when the game runs almost everything gets smacked like its being hit by something, none of my levels are together…so the three levels i had together are not anymore…even tho there are bricks in the heiarchy…ive reset…but seriously not sure what to make of this…ill take a video if it persists

and sorry Gday Joao! didnt mean to be rude…im goin fine mate :smiley: busy as a mo fo tho…hows yourself?

yer man…my game is basically gone lol…i have no idea what just happened…was there just a few minutes ago…prefabs gone from scene heirachy…so like level 4 had no playspace…all the bricks are mentioned in the heiarchy but are not placed in the game space and playable like they were…and i hear the noise that happens when the blocks get destroyed right away as soon as the game starts LOL

Ok, sounds like you are having a number of issues here…

Regarding losing everything, as you had made the project available for me to download, why not grab yourself a copy from there? You may have a few differences, but at least the bulk of things, as they were, is still secure.

Turning off IsKinematic would tell Unity that it is now in control of the block’s movement, as such they will be affected by physics. I would hazard a guess that every one of your blocks just moved down slightly and made contact with every other brick.

Regarding the layout of the blocks, it sounds like you may have reset the transforms for the bricks, or perhaps they have been moved out of the playspace parenting game object?

Double click on one of the bricks in the Hierarchy and see where the Scene view focuses, then select the next brick in the Hierarchy and see if it is adjacent to the first, if so, your pattern may still be in place as the transform positions may still be correct, but just not in relation to a parent game object.

1 Like

ahah yerrr i was thinking about the copy i made last time too…probably the way to go…i really want to understand what has happened here as well…seriously man…i changed nothing that i didnt change last night and then suddenly bam everythings broken LOL…but obviously SOMETHING happened…
have u had any experiences with losing attached objects like the music like crack or the smoke particles having been attached and when you come back to the project it not being attached anymore or being a different thing? Ive been having this almost the whole way through the course…thinking its a unity release quirk…?

would you like to have a look at my current game? i could zip it for u to have a peep…?? im gonna do it anyway to archive it so i can keep a record of problems - unless i figure out the exact nature of whats happened…it may be as you said with the transform positions…so i will check this out before i give up XD…i should probably be more annoyed but im doing my best to practice calmness and treating it all as a learning experience…ive found everytime ive come against something like this through the course and not freaked out and just kept on going ive learned from it and gotten better…so its all good…AT least this isnt some project ive been working on for YEARS or something LMFAO!! and i think its a good example whyi need to keep stable copies of my game as i progress through projects…just as a habit…reglarily save safe editions i can come back to…

Hello, Im fine over here too, what seems to be happening is that the bricks are colliding with each other and triggering their handlehit method, make sure to put it within an if statement checking if they collided with the ball. You could also prevent it by configuring it in the physics 2d collision matrix

1 Like

ok so these are screen shots of my level 2…which was a completed level everything went to hell lol…
i had not changed anything on this level…the bricks have all come back together…like how i had them when i created them before i put them into rows…this is what has happened to every other level except level 1 which i was on when i was playing around with the smoke…level one is still intact but like i said all the bricks break right at the start…
Im wondering if i accidentally pressed something on the prefabs…??? and that put everything out of joint…???

Brickbreak major failure archive - 1.zip (7.6 MB)

ok so these are the files if u guys are bored and want a peep…i think im gonna track down my last one and start over and get back to the end of course where the smoke bit is put in and see if this happens again…cheers guys lol XD

Your blocks are there, they are simply all sitting on top of each other. You have also moved all of the brick game objects out of the playspace.

The brick transform positions are the same as the prefabs in the Assets folder, no longer unique to where you want them in the playspace.

1 Like

thats the thing tho…i didnt touch the bricks…the only thing i did was remove the smoke code…somewhere between before moving the smoke code around and testing and after…everything shifted…all of those bricks were in rows…when i first made the level it looked like this sitting on top of each other and o moved them out…cant really understand how everything has moved…because i def didnt muck around with the transforms at the top…

Assuming that you saved the scene, the only other thing would be if you applied changes to the prefab.

For example, if you look at scene 2. Note the 1 hit pink block. There are lots of these on top of each other. Note the transform position. Then look at the prefabs folder within Assets. Look at the 1 hit block, note how the position is the same.

Reset the position for the 1 hit block in Assets, and note how they all move in the scene.

1 Like

what a ****** mess LOL…must be that…just no idea how that happened…

If you dont have anymore suitble back-ups, I’d suggest using the zip you offered me previously, then just re-apply any changes/fixes since. Make sure you are happy with everything at that point, then make another copy before continuing on. :slight_smile:

It wouldn’t take that long to re-arrange your blocks either though to be fair.

1 Like

other thing is too…the playspace is missing from the heirachy…its more than just the bricks having moved…it seems to me that it would have taken a few actions to make this happen…and i know that one second everything worked…next it didnt…which is really weird

Privacy & Terms