I would like to use variables that are inside my custom projectile, from my custom weapon class
Ex: MyProjectile(Something).MyVar
what would "Something" be if I am inside my custom weapon class?
Thank you![]()
I would like to use variables that are inside my custom projectile, from my custom weapon class
Ex: MyProjectile(Something).MyVar
what would "Something" be if I am inside my custom weapon class?
Thank you![]()
I think you'd need to spawn it first, and then you can access it like any other variable. Ie, inside your weapon ProjectileFire function you would do:
Code:SpawnedProjectile = Spawn(GetProjectileClass(), Self,, RealStartLoc); SpawnedProjectile.MyVar // This is the var I want
thank you it did the trick![]()

It depends what you want to use. If the variables are class defaults, you can just access them like this:
If you're using archetypes, you can reference the archetype and then use it as if you've instanced it.Code:class'UDKProjectile'.default.MyVar
Code:local UDKProjectile UDKProjectileArchetype; UDKProjectileArchetype = UDKProjectile'MyPackage.MyProjectile'; if (UDKProjectileArchetype != None) { UDKProjectileArchetype.MyVar; }
Bookmarks