jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 22 Aug 2012 03:18 PM |
This is part of a Monster's Follow script:
while true do wait(math.random(1,5)) local target = findNearestTorso(script.Parent.Torso.Position) if target ~= nil then script.Parent.Zombie:MoveTo(target.Position, target) end
end
I want to know why the Zombe dosn't move straight towards the NearestTorso's position. Can anyone explain? |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:19 PM |
maybe too much waiting?
† KMXD 2.0 † |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 22 Aug 2012 03:20 PM |
| No, it moves correctly. I want to know the reason for it doing it successfully. I apologize for the fact that this is a Free Model. I am trying to understand it. |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:21 PM |
It basically just checks for torsos in the dist, which is 100.
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 22 Aug 2012 03:23 PM |
| But why dosn't it teleport to the nearest torso? To me thats what it looks like it should do. |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:24 PM |
The :MoveTo() method will make the zombie walk there.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:25 PM |
I don't know myself, I've never invented with Humanoid commands.
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 22 Aug 2012 03:26 PM |
| @KnightMare it does? I didn't know that. |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:26 PM |
| :WalkTo(thing) Teleports it there. WalkTo(position, thing) will actually make it walk. |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:26 PM |
Hmm, this is what object browser says,
void MoveTo(Vector3 location, Instance part) Member of Humanoid Summary: Attempts to move the Humanoid and it's associated character to 'part'. 'location' is used as an offset from part's origin.
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:27 PM |
Ahah! I know how it works, zombies have humanoids called "Zombie" so it's using the humanoid, I was practically right o.o
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:28 PM |
Theres no walkto, its moveto. MoveTo with models will make it instantly "teleport", but with Humanoids, make the model walk there.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:29 PM |
| Oops, yeah MoveTo(). IIRC tho, there is a walkto() |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:31 PM |
MoveTo() Functions like this in model:
void MoveTo(Vector3 location) Member of Model Summary: Moves the centroid of the Model to the specified location, respecting all relative distances between parts in the model.
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:33 PM |
Oh, look, my fanalt can copy/paste. :D
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 03:35 PM |
I'm not your fanalt anymore, you dislike me. :(
Θ_Θ Sage Mode! |
|
|
| Report Abuse |
|
|
| |
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
| |
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 22 Aug 2012 04:02 PM |
So why dosn't this make it move: while true do spawn = game.Workspace.SpawnLocation script.Parent.Zombie:MoveTo(spawn.Position, spawn) wait(1) end |
|
|
| Report Abuse |
|
|