Yes, that's the idea. The function should accept none. Try harcoding values to see if the Actor works as intended. If it works, figure out how to fix your variables.
I've also led you into error by forgetting to put a few commas. The input variables should always correspond with the parameters in the prototype.
For example the following won't compile because there is a comma missing after HitLocation and the compiler will assume that 'SomeDamageType' is the value given for Momentum.
Since 'SomeDamageType' isn't a vector, this will produce an error. To avoid this, either put a value or variable for each parameter or enter a space where the parameter should go, like so :
Code:
Owner.TakeDamage(5, None, , , 'Poisoned');
I've also led you into error by forgetting to put a few commas. The input variables should always correspond with the parameters in the prototype.
For example the following won't compile because there is a comma missing after HitLocation and the compiler will assume that 'SomeDamageType' is the value given for Momentum.
Code:
// Prototype: TakeDamage( int Damage, Pawn InstigatedBy, Vector HitLocation, Vector Momentum, name DamageType );
TakeDamage(50, aPawn, vect(0,0,0), 'SomeDamageType' );
Since 'SomeDamageType' isn't a vector, this will produce an error. To avoid this, either put a value or variable for each parameter or enter a space where the parameter should go, like so :
Code:
// Prototype: TakeDamage( int Damage, Pawn InstigatedBy, Vector HitLocation, Vector Momentum, name DamageType );
TakeDamage(50, aPawn, vect(0,0,0), , 'SomeDamageType' );
Last edited: