I want to create a speeder bike, but to make it move, I want Roblox’s physics to do all the work, I forget what it’s called, my guess is vector force? I want to give it a number and it will go in that direction.
2 Likes
You can use BodyVelocity to move something. For example, this script makes a part move in the x axis when touched by a player.
local part = script.Parent --variable to define what part is
part.Touched:Connect(function(hit) --event that fires when part is touched
if hit.Parent:FindFirstChild("Humanoid") then --checks if player touched it
local velocity = Instance.new("BodyVelocity", part) --creates a new BodyVelocity and sets the parent to be the part
velocity.Velocity = Vector3.new(100, 0, 0) --specifies which direction and how fast the part moves
end
end)
3 Likes
Quick question, what does the 100 mean? 100 studs a second? Is there a way to know how fast something will go without using trial and error?
I believe that the number corresponds to the amount of studs traveled per second, so yeah 100 would be 100 studs per second.
1 Like