Next Star Industries

Next Star Industries

10.5k Downloads

Bullet explosion

dogevspenguin opened this issue ยท 5 comments

commented

So i install yours NSI and fire the Nuclear val it seem like the explosion is sideway and i suspect it up to the rotation of the gun since when i shoot down(Upside down nuclear val)the explosion goes under the terrain and i think this is BDA issue as it check where the barrel is facing and thus exploding the same direction,which is sideway

commented

Yes I'm aware of this and yes it's a BDA transform issue.

commented

Hmmm anyway to fix this

commented

I use code to force the transform to the rotation I want with this code:
Quaternion rotation = Quaternion.LookRotation(VectorUtils.GetUpDirection(position));
Take a look at how I setup the explosion module in the source code here: https://github.com/NextStarIndustries/Next-Star-Industries/blob/master/Source/NextStarIndustries/NextStarIndustries/NSIExplosionModule.cs
I use the world orientation and feed that back to BDA through this code:
ExplosionFx.CreateExplosion(position, blastPower, explSpacePath, explSoundPath, isMissile = true, caliber = 0, explosivePart = null, default);
and let BDA do what it needs to do like damage and so forth. So my code basically just takes the world cords, plus I add an altitude check to determine which fx.mu to pull up and the fx.mu I want to show for that weapon and give that back to BDA.

commented

but then this still raise the question...How to check when bullet got hit.I already try look through BDA weapon module code

commented

but then this still raise the question...How to check when bullet got hit.I already try look through BDA weapon module code

I don't know how they do the bullet hit checks.