| Blockland Forums > Modification Help |
| Playing sound from location of projectile impact? |
| << < (2/3) > >> |
| Tendon:
No it doesn't have to be in a package. That's just how I do things. In this case I was messing w/the default gun, and I parented the original function and: When parenting a function I package it up. Otherwise if the file is executed more than once, I can get unexpected behavior, such as previous changes still being in effect, or actions being run more than once. :P |
| phflack:
if it's your own projectile that you're just trying to make bounce and play sound, I suspect you don't need to parent or anything, just copy what the HE grenade does |
| Ctrooper:
I tried copying what the HE grenade does but that wasn't working either i keep getting this: --- Code: ---Add-Ons/Vehicle_Humvee/sfx.cs (296): Unable to find object: '' attempting to call function 'getClassName' BackTrace: ->SMAWProjectile::onCollision->SFXEffect::playFrom --- End code --- in the console |
| phflack:
Post the code you used for the sound It should be like two lines of code? |
| Ctrooper:
--- Quote from: phflack on November 02, 2017, 02:34:22 PM ---Post the code you used for the sound It should be like two lines of code? --- End quote --- Its litterally just this line of code --- Code: ---FireSFX.playFrom(%obj.getMuzzlePoint(%slot), %obj); --- End code --- and then the support script thats posted on the topic already, they work in unison. |
| Navigation |
| Message Index |
| Next page |
| Previous page |