This has been driving me crazy for a while, and i know it's possibile.
I'm trying to access a global variable from another class, i got the code from http://wiki.beyondunreal.com/wiki/Typecasting
But when i log the variable, it always returns 0.00
here's the variable i want to call.
and this is where i want to call it:
i just don't get it.
any help is appreciated.
thanks
I'm trying to access a global variable from another class, i got the code from http://wiki.beyondunreal.com/wiki/Typecasting
But when i log the variable, it always returns 0.00
here's the variable i want to call.
Code:
class MyShockProjectile extends ShockProjectile;
var float MyVar;
function SuperExplosion()
{
MyVar = 10
log("test: "$myVar); // returns 10
Spawn(class'MyShockCombo');
.....
}
and this is where i want to call it:
Code:
class MyShockCombo extends ShockCombo;
var class<actor> ConvertMe;
simulated event PostBeginPlay()
{
local float x;
ConvertMe = class'MyShockProjectile';
x = class<MyShockProjectile>(ConvertMe).Default.MyVar;
......
log(x); // returns 0.00
}
i just don't get it.
any help is appreciated.
thanks