GetActorReference Problem

Post » Sat Feb 02, 2013 9:33 am

I am trying to change some settings to companions but am having trouble with the GetActorReference. When I pass this part of the code I get a response form the notification that it is 'NONE'.

(This script extends ReferenceAlias)
Spoiler

Actor npc = (Companion1 as ReferenceAlias).GetActorReference()
Debug.Notification ("NPC is "+ npc )
npc.SetPlayerTeammate(abCanDoFavor = false)
npc.GetActorBase().SetInvulnerable(false)

I have a ReferenceAlias created in my quest and selected a Unique Actor. Am I doing something wrong?
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Return to V - Skyrim