Announcement

Collapse
No announcement yet.

Projectil weapon problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Projectil weapon problem

    my projectiles spawn with 0 speed nomatter what. what am i doing wrong?

    #2
    Re: Projectil weapon problem

    Originally posted by FireCrack
    my projectiles spawn with 0 speed nomatter what. what am i doing wrong?
    Well for starters, you're not posting your code or explaining the context.

    Comment


      #3
      stupid me....


      Projectile
      Code:
      //-----------------------------------------------------------
      //
      //-----------------------------------------------------------
      class gPistolBullet extends Projectile;
      
      #exec OBJ LOAD FILE=Gunreal_Effects.utx
      #exec OBJ LOAD FILE=Gunreal_Effects.u
      
      var xEmitter Trail;
      
      simulated function Destroyed()
      {
          if ( Trail !=None )
          {
      		Trail.mRegen=False;
      	}
      	Super.Destroyed();
      }
      
      function PostBeginPlay()
      {
          Trail = Spawn(class'FlakTrail',self);
          Super.PostBeginPlay();
      }
      
      simulated function ProcessTouch (Actor Other, vector HitLocation)
      {
      	if ( Other != Instigator )
      	{
      		Explode(HitLocation,Normal(HitLocation-Other.Location));
              Other.TakeDamage(Damage,Instigator,HitLocation,(MomentumTransfer*velocity),myDamageType);
          }
      }
      
      simulated function Landed( Vector HitNormal )
      {
      	Explode(Location,HitNormal);
      }
      
      simulated function HitWall( vector HitNormal, actor Wall )
      {
          Landed(HitNormal);
      }
      
      simulated function Explode(vector HitLocation, vector HitNormal)
      {
          local rotator dir;
      
          dir=rotator(HitNormal);
          spawn(class'Gunreal_Effects.gPistolHit',,,HitLocation,dir);
      	Destroy();
      	//TODO: add play sound, decal
      }
      
      
      
      defaultproperties
      {
          speed=1200.000000
      
      	Damage=10
      	MomentumTransfer=10000
      	myDamageType=class'gDamTypePistol'
      
          DrawType=DT_StaticMesh
          StaticMesh=StaticMesh'WeaponStaticMesh.FlakChunk'
      
      	DamageRadius=0
      	SoundVolume=10
      	LifeSpan=15
      	TossZ=0
      }
      fireclass
      Code:
      //-----------------------------------------------------------
      //
      //-----------------------------------------------------------
      class gPistolFire extends ProjectileFire;
      
      DefaultProperties
      {
          AmmoClass=class'gPistolAmmo'
          AmmoPerFire=1
      
          ProjectileClass=class'gPistolBullet'
      
          spread=400
      
          FireRate=1
          ProjSpawnOffset=(X=25,Y=9,Z=-12)
      }

      Comment


        #4
        In post begin play trying setting this
        Code:
        Velocity = normal(vector(Rotation)) * Speed;

        Comment


          #5
          thanks, i dont know why epic doesnt have that in their projectile class, nor why their other projectiles seem to work without it.

          Comment


            #6
            Something with bInheritVelocity or something like that... just look at projectiles postbeginplay... it should be in there... also sometimes they apply stuff right in the gun

            Comment

            Working...
            X