Bobogijoe
|
  |
| Joined: 04 Mar 2010 |
| Total Posts: 640 |
|
|
| 23 Dec 2014 02:07 PM |
(I know this forum is not for scripting questions, but I didn't find the appropriate one...)
Iv'e made an NPC character and he walks around (done with the Humanoid's MoveTo() method ). When he detects a player nearby, he then starts to chase it. The problem is that he is still trying to acheive the first point he was walking to when he starts chasing... So I was wondering... is there a way to stop the MoveTo() method, to abort it?
thanks.Gnomes.
|
|
|
| Report Abuse |
|
|
| |
|
Funse
|
  |
| Joined: 11 Jun 2012 |
| Total Posts: 7887 |
|
| |
|
Bobogijoe
|
  |
| Joined: 04 Mar 2010 |
| Total Posts: 640 |
|
|
| 23 Dec 2014 02:14 PM |
If I send it walking to (0,0,0), its just another task it adds to its "list of tasks".
And that's just it: I can't break. Because the MoveTo() method is like a coroutine acting on the humanoid and once you fire it... it won't stop until it's acheived.
I would like to "End task". ... |
|
|
| Report Abuse |
|
|
Bobogijoe
|
  |
| Joined: 04 Mar 2010 |
| Total Posts: 640 |
|
|
| 23 Dec 2014 02:16 PM |
| Well atleast thats how I think it works |
|
|
| Report Abuse |
|
|
Funse
|
  |
| Joined: 11 Jun 2012 |
| Total Posts: 7887 |
|
|
| 23 Dec 2014 02:17 PM |
You could use break if your using moveto in a for loop. for i=0,10,1 do nub.Humanoid:MoveTo(nub.Torso.Position + Vector3.new(0,i,0)) if i == 9 then break; end end |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2014 02:20 PM |
| Or you could go with the perfectly logical answer, make them walk to the position they are currently standing on.... |
|
|
| Report Abuse |
|
|
Bobogijoe
|
  |
| Joined: 04 Mar 2010 |
| Total Posts: 640 |
|
|
| 23 Dec 2014 02:22 PM |
Yeah that's what I did to try and stop them. It does. He stops moving but hes legs are still walking (in place)... I'll investigate some more... TO THE STUDIO! |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2014 02:22 PM |
I mean, that just sounds a lot less complicated than what you are doing at the moment.
Also, I am trying to help a member of GnomeWorks :D They were hiring, but I would have been too lazy to do much. So at least my conscience is clear now. |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2014 02:22 PM |
| Oh. That is very interesting. I have no idea why that happens, actually. |
|
|
| Report Abuse |
|
|
Bobogijoe
|
  |
| Joined: 04 Mar 2010 |
| Total Posts: 640 |
|
|
| 23 Dec 2014 02:26 PM |
Probably some script logic I've overseen. And thank you Jarod. (I'm working on GnomeWorks newest project).
|
|
|
| Report Abuse |
|
|
|
| 23 Dec 2014 02:44 PM |
| humanoid:MoveTo(humanoid.Parent.Torso) |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2014 02:47 PM |
| Whoops, didn't see Jarod's post. |
|
|
| Report Abuse |
|
|