Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

how to assign projectile direction ?

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

  • how to assign projectile direction ?

    hello i'm trying to assign the direction of my projectile, in my game the hero have the power to shot a ball of energy, i'm using the LinkPlasma projectile to simulate the energy ball, with no gun in my hero's pawn.

    when the player press the "fire key" i will spawn the projectile, i have created my own projectile class extending it from UTProj_LinkPlasma, but i can't figure out how to assign the direction.

    when the player hit fire the projectile show of but it goes in other direction than the player's forward direction.

    this is the code of my projectile

    Code:
    class PlasmaBeam extends UTProj_LinkPlasma;
    
    var vector ColorL;
    var vector ExplosionCol;
    
    function Init(vector Direction)
    {
    	SetRotation(Rotator(Direction));
    
    	Velocity = Speed * Direction;
    	Acceleration = AccelRate * Normal(Velocity);
    }
    
    
    defaultproperties
    {
    	MaxEffectDistance=7000.0
    
    	Speed=500
    	MaxSpeed=2000
    	AccelRate=200.0
    
    	Damage=150
    	DamageRadius=0
    	MomentumTransfer=0
    	CheckRadius=26.0
    
    	MyDamageType=class'UTDmgType_LinkPlasma'
    	LifeSpan=3.0
    	NetCullDistanceSquared=+144000000.0
    
    	bCollideWorld=true
    	DrawScale=4.2
    
    	ColorL=(X=5,Y=1.3,Z=1)
    	ExplosionCol=(X=95,Y=1,Z=95);
    }
    and here is the code that i'm using to spawn the projectile

    Code:
    function SpawnBeam()
    {
            local Projectile Beam;
    	local vector newLocation;
    
            newLocation = Location;
    	newLocation.X += 100;
    	Beam = Spawn(class'PlasmaBeam',self,,newLocation);
    	Beam.Init(newLocation);
    }
    somebody has an idea on waht i'm doing wrong ? can somebody help me with this ?

    thank you in advance for your help ....
Working...
X