Casting 'ObjectReference' as 'ActiveMagicEffect'

Post » Mon Apr 08, 2013 9:51 am

Is it possible? Found on wiki:

Only other objects can be cast to objects, and only if that object is a direct child or parent of the one being cast. If you are casting from the parent object to the child one, the cast may fail if it isn't actually an instance of the child object, in which case the result will be None.

I tried:
TestEffect tEffect = akActionRef as TestEffect
inside of 'ObjectReference' script where TestEffect is the name of my 'ActiveMagicEffect' extending script, but im getting:

"cannot cast a objectreference to a testeffect, types are incompatible"


Any idea what could be the reason?
User avatar
Javier Borjas
 
Posts: 3392
Joined: Tue Nov 13, 2007 6:34 pm

Return to V - Skyrim