As of now, I've been using multiple scripts to deal with my cutscenes, and I'm quickly finding it's slowing things down. Let's say that, for instance, we had these lines --
game.Players.LocalPlayer.Character.Humanoid:MoveTo(Vector3.new(1, 2, 3)) -- wait until player reaches above point game.Players.LocalPlayer.Character.Humanoid:MoveTo(Vector3.new(2, 2, 4))
The full script is inside of a LocalScript in a GUI inside of the player.
I can think of a couple things that might be able to make it multi-point:
Add a wait(X)
afterwards for the specific time to each point
Some sort of check between the WalkToPoint
and TargetPoint
properties.
if
or repeat until
.I would like to avoid any use of a Touched
function with hit
, since that will make the GUI method somewhat redundant and hard to use, make nil
inputs a huge pain, et cetera.
Thank you for reading, and I hope to find a solution to the problem
EDITED --
local lplayer = game.Players.LocalPlayer.Character.Humanoid lplayer:MoveTo(Vector3.new(-184.3, 751.101, 1.9)) print("Move1") -- Print displays repeat wait() until game.Players.LocalPlayer.Character.Torso.Position == Vector3.new(-184.3, 751.101, 1.9) lplayer:MoveTo(Vector3.new(-169.5, 751.101, 0.9)) print("Torso == 1") -- Print does NOT display repeat wait() until game.Players.LocalPlayer.Character.Torso.Position == Vector3.new(-169.5, 751.101, 0.9)
Try using a repeat loop
to wait until the Torso's Position
property in the player's character is equal to the Vector3 you want the character to move to. That's what I used to create a short little sequence based on a TV series I've been getting into called "Person Of Interest".
Example:
repeat wait() until game.Players.LocalPlayer.Character.Torso.Position == Vector3.new(1,2,3) --Just an example Vector3, change as needed.