Make my plane go forward infinetly?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A plane that goes forward.

  2. What is the issue? Include screenshots / videos if possible!
    How do I make it go forward infinetly?

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    No solutions on the dev hub. I have already looked on youtube, it is just “get this free model”.

3 Likes
while task.wait() do -- this code should prevent the plane from falling

Plane.PrimaryPart.AssembilyLinearVelocity = Vector3.new(x,0,z) -- fill the x and z cordinates with your own

end

Plus I would advise you to provide more context as you aren’t aloud to make others make you stuff for you.

1 Like

It says ApplyLinearVelocity is not a valid member of Part.

1 Like

Again you provided no context towards how you wanted the plane to be made, and no I’m not going to make an entire plane system for you. I would atleast advise you to try and make something on your own first and then ask the forum if you get stuck on something.

1 Like

I am not asking for an entire plane system. I am asking how you make an object go infinitely forward.

local config = require(script.Config)

local Variables = script.Variables

-- OBJECTS --

local Plane = script.Parent

local Gear = script.Parent.Gear
local Canopy = script.Parent.Canopy
local Flaps = script.Parent.Flaps
local Tail = script.Parent.Tail

-----------------------------------

game.Players.PlayerAdded:Connect(function(plr)
	_G.player = plr
end)

local tweenService = game:GetService("TweenService")

Variables.Airspeed:GetPropertyChangedSignal("Value"):Connect(function()
	if Variables.Engine.Value == false then return end
	moveForward()
end)

Variables.GearDeployed:GetPropertyChangedSignal("Value"):Connect(function()
	if Variables.Engine.Value == false then return end
	if Variables.GearDeployed.Value == false then Gear.Parent = game.ReplicatedStorage return end
	if Variables.GearDeployed.Value == true then Gear.Parent = script.Parent return end
end)

Variables.Canopy:GetPropertyChangedSignal("Value"):Connect(function()
	if Variables.Engine.Value == false then return end
	local currentPivot = Canopy:GetPivot()
	local openPivot = currentPivot * CFrame.Angles(0, 0, math.rad(65))
	local closedPivot = currentPivot * CFrame.Angles(0, 0, math.rad(-65))
	
	if Variables.Canopy.Value == true then canopyOpen() return end
	if Variables.Canopy.Value == false then canopyClose() return end
end)

--// FUNCTIONS \\--

local open_track = Canopy.AnimationController:LoadAnimation(script.Animations.CanopyOpen)
local close_track = Canopy.AnimationController:LoadAnimation(script.Animations.CanopyClose)

local lock = true

function moveForward()
	local root = Plane.PrimaryPart
	local speed = Variables.Airspeed.Value
	root.CFrame = root.CFrame + (root.CFrame.LookVector * Vector3.new(speed,0,0))
end

function canopyOpen()
	open_track:Play()
	open_track.Stopped:Connect(function()
		if lock == false then return end
		open_track:Play(0, 1, 0) --Will restart the track at the beginning, fadeIn 0 so it immediately has appropriate weight, speed 0, so that it pauses
		open_track.TimePosition = open_track.Length - .000001 --Something small enough that it's not truly at the end, causing a reset
	end)
end

function canopyClose()
	lock = false
	open_track:Stop()
	close_track:Play()
	close_track.Stopped:Connect(function()
		lock = true
	end)
end

--// GUI \\--
wait(2)
local ui = script.PlaneGui:Clone()
ui.Parent = _G.player.PlayerGui
while true do
	wait()
	Variables.Altitude.Value = Plane.Body.CFrame.Y
	local altitude = math.floor(Variables.Altitude.Value)
	ui.MainBar.Altitude.Text = "Altitude: "..altitude
	local gearVal = ''
	if Variables.GearDeployed.Value == false then
		gearVal = 'Up'
	else
		gearVal = 'Down'
	end
	ui.MainBar.Gear.Text = "Gear: "..gearVal
	ui.MainBar.Gear.Text = "Flaps: N/A"
	local canopyVal = ''
	if Variables.Canopy.Value == false then
		canopyVal = 'Closed'
	else
		canopyVal = 'Open'
	end
	ui.MainBar.Gear.Text = "Canopy: "..canopyVal
end

I’d suggest you look into plane kits that are already available on the Roblox toolbox as many of them will provide you with what you’re looking for! And you will be able to learn from them as making an object move forward in the way you want it to can be ticky without lots of experience using body Gyros and other constraints like that

in the moveForward() function you can do this

function moveForward()
	local root = Plane.PrimaryPart
	local speed = Variables.Airspeed.Value
	root.AssembilyLinearVelocity = root.CFrame + (root.CFrame.LookVector * Vector3.new(speed,0,0))
end

No errors but it’s not moving, it is unanchored.

It’s pretty clear that you aren’t much of an experienced programmer as the code you provided clearly is largely out of date. I would recommend learning more about how to actually program in Roblox Lua before heading on into something like this.

Although I would recommend using LinearVelocity which can be used to move the plane as a physics object and try to make a system from scratch.

I’ve been programming lua for 4 years and always had problems with linear velocity

1 Like

Really? 4 Years? and you still don’t know how to make a simple plane go forward and provide almost zero context? Did you really learn anything from those 4 years?

I’m not trying to start an argument, I’ve never made any type of vehicle in studio. There is not really much to share, all I’m asking is how you make a normal part go forward infinitely. I have already tried several things which didn’t work.

1 Like

honestly, i cannot see why it wouldnt work, maybe the speed or root isnt set correctly? or maybe the plus sign in

root.CFrame = root.CFrame + (root.CFrame.LookVector * Vector3.new(speed,0,0))

should be changed for an * ?

I am very sorry about my past behavior, but I will provide this place which includes a part that will infinitely move forward and say in the air
Place2.rbxl (45.9 KB)

I will try both of these above.

1 Like

It works. Thank you very much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.