Hello, I want to make a script that makes the player move at a constant speed without the player pressing “W”. I would like some examples or tutorials. Thank you.
Check out bodyvelocity:
BodyVelocity isn’t quite linear, but not a bad choice nonetheless.
I think the user might be looking more for Assembly Linear Velocity.
That would probably work. I’m just thinking that assembly linear velocity requires a part that the player stands on, right? I suppose there could be a transparent part though. That’s probably a better choice.
No. It is a property of BasePart
that changes the velocity of the entire model assembly.
If I use Assembly Linear Velocity, will my character able to jump, speed up, or stop? Thanks.
I don’t know. You’ll have to test it out.
Ok, Thanks, I will test it out.
The Humanoid has a function called :MoveTo
, which tells the humanoid where to move. This will move it toward the specified position until the player stops themselves by using movement keys. As said earlier, you can also use Velocities to do this. You can read up on this below:
I hope this helps!
Also, does the template from Roblox Studio, “Line Runner” use Assembly Linear Velocity? Because I want to make something like the system from the template, “Line Runner”.
Thanks, but doesn’t Humanoid:MoveTo() teleport players to a certain locations instead of making the player move without pressing “W”?
No, you are thinking of Model:MoveTo()
. :MoveTo()
is a function of model as well, and moves the model, while Humanoid:MoveTo()
moves it like a normal player.
Thanks, I will test it out too.
Also, can the player still have control to itself? Because I want the players to still have control (like moving side to side) while they are moving forward without pressing “W”.
That is different. It uses a custom movement system, not that property.
Set their HumanoidRootPart
velocity to the direction you want, something like:
local hrp.Velocity = Vector3.new(10,0,0)
That would cause the player to move in the X vector at a speed of 10.
Sorry, but how can I put Assembly Linear Velocity to a script? Do I do player.AssemblyLinearVelocity? Thanks, I’m not familiar to scripting.
Is “hrp” meaning players?
Oh sorry, hrp
is short for HumanoidRootPart
and the latter is located inside the player’s character.
Do I put this script in ServerScriptService or StarterPlayerScripts? Thanks.