Jump to content

Cannot call MoveTo() on a None object


RavingKeroro

Recommended Posts

I'm trying to make a mod that basically involves teleporting a player to a certain marker when you press a key. The only problem is that even though I filled out the property in the properties window, when I try to use it in my script, the papyrus log reports:

[08/26/2016 - 01:37:12AM] Error: Cannot call MoveTo() on a None object, aborting function call
stack:
[Active effect 1 on  (00000014)].pkoAbilityScript.OnKeyDown() - "pkoAbilityScript.psc" Line 68
Here's my script:

Scriptname pkoAbilityScript extends activemagiceffect  

Actor Property Player  Auto  
ObjectReference Property RespawnMarker  Auto  
 
Event OnEffectStart(Actor akTarget, Actor akCaster
RegisterForKey(37)
EndEvent
 

 
Event OnKeyDown(int keyCode)
 
if(keyCode == 37)
debug.messagebox("teleporting")
player.moveto(RespawnMarker)
endif
 



The ability is being added to the player's inventory when the game loads. This is tested on a fresh game where I use the coc command from the main menu.

 

I've placed an xMarker in a cell and I'm in the same cell as the xMarker

 

The key does make the message show up, but does not teleport the player.

 

I'm pretty sure something bugged out on me or I'm just missing something really really small

 

Thanks

 

EDIT:I deleted and re added all my properties and now it works...

Edited by RavingKeroro
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...