PoorLeno Posted February 20, 2012 Share Posted February 20, 2012 I'm attempting to make an actor (In this case, a cow) move to me after the room is loaded. To do this, I thought this would be a valid script: Scriptname CowMove extends ObjectReference {Moving the cow} ObjectReference property MyRef auto Event onLoad() MyRef.PathToReference(Game.GetPlayer(), 0.5) endEvent This results in a "PathToReference is not a function or does not exist" error. This is what I'm trying to use, as I believe it will do what I want. Is this a valid use of this function, or is there a better way to do this? Link to comment Share on other sites More sharing options...
tunaisafish Posted February 20, 2012 Share Posted February 20, 2012 Notice from that page you linked that PathToReference is a function of Actor, not ObjectReference. (The Actor object extends ObjectReference) So either of these changes should work... Actor property MyRef auto or (MyRef as Actor).PathToReference(Game.GetPlayer(), 0.5) Link to comment Share on other sites More sharing options...
PoorLeno Posted February 20, 2012 Author Share Posted February 20, 2012 It compiles, but my cow just sits there and doesn't follow me. I've rewritten it slightly, and threw in a messagebox so I know it at least starts the event, but is there something I'm missing to make this cow move to me? Scriptname CowMove extends ObjectReference {Moving the cow} Actor property MyRef auto Event OnCellAttach() Debug.MessageBox("Activated") MyRef.PathToReference(Game.GetPlayer(), 0.5) endEvent Link to comment Share on other sites More sharing options...
tunaisafish Posted February 20, 2012 Share Posted February 20, 2012 It could be a navmesh issue.If that's okay, then look into timing. ie. put a utility.wait() into the above, or create an activator onject so you can test at will that your cow can move. Link to comment Share on other sites More sharing options...
PoorLeno Posted February 20, 2012 Author Share Posted February 20, 2012 Hmm, this is the first I've heard about navmeshes, and after applying one, I seem to have gotten it to work. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts