Does anyone know how to make it so the player constantly moves forward without them pushing any buttons and it just makes them move forward by itself?
there are lots of different ways depending on what you want, probably some I’m missing
- Player:Move() [to allow for player input]
- AlignPosition / LinearVelocity / VectorForce / constraints in general [physics engine movement]
- Interpolation [code-based movement]
- Humanoid:MoveTo() [like Player:Move() but usually used with NPCs or when the player doesn’t directly control a character, like in a cutscene]
Use
Character:MoveTo( Character.HumanoidRootPart.CFrame.lookVector * 1000 )
1000 stands for 1000 studs ( You can change it to your will accordingly )
i used the humanoid:moveto() method and it seemed to work for me, as it moves the player to the target position as i wanted, thanks for the advice
This one instantly teleports the player to the target position which isnt really what i want, but i didnt know this type of :moveto() could be used to teleport people (i only started developing games last year) so thanks for the advice as well
If i can ask one more question, how can i make it so it continously moves to the part and only stops until it reaches its target? Since the player eventually stops moving to the part during its path to it
Hello, when using Humanoid:MoveTo()
, use Humanoid.MoveToFinished
. This event fires when the humanoid completes its move. If you’re still learning how to code, it might be easier to use Humanoid.WalkToPart
.
Humanoid.WalkToPart = workspace.Part
If you want to explore other options, you can refer to the Roblox documentation on Humanoid.
Remember to research before posting your questions to ensure they’ve not been answered already.
sorry I meant Humanoid:MoveTo()