Where would I get started making a aircraft/ airship / plane

So I wanted to make a airship (kinda like a blimp ig) but idk where to start. Can anyone tell me what resources I can use and/or what I could do? I have very little experience in physics

1 Like

Here is some code to get you started:

local airship = script.Parent
local airshipPart = airship.Airship

-- Function to move the airship
local function moveAirship(direction)
  local velocity = airshipPart.Velocity
  velocity = velocity + direction
  airshipPart.Velocity = velocity
end

-- Keybinds to control airship movement
local forwardKey = "w"
local backwardKey = "s"
local leftKey = "a"
local rightKey = "d"
local upKey = "r"
local downKey = "f"

-- Function to handle key inputs
local function onKeyDown(inputObject)
  local keyCode = inputObject.KeyCode
  if keyCode == forwardKey then
    moveAirship(Vector3.new(0, 0, 1))
  elseif keyCode == backwardKey then
    moveAirship(Vector3.new(0, 0, -1))
  elseif keyCode == leftKey then
    moveAirship(Vector3.new(-1, 0, 0))
  elseif keyCode == rightKey then
    moveAirship(Vector3.new(1, 0, 0))
  elseif keyCode == upKey then
    moveAirship(Vector3.new(0, 1, 0))
  elseif keyCode == downKey then
    moveAirship(Vector3.new(0, -1, 0))
  end
end

-- Connect key down event
game:GetService("UserInputService").InputBegan:Connect(onKeyDown)

I actually created a drone for a project I worked on in December so if you need any other advice let me know. Here is a test version of the drone: Drone Test - Roblox

1 Like

ty, but is there a way to apply acceleration/deceleration/ constant movement?

or make it just more realistic in general?

To make the airship constantly move you would have to create an Airship Class. Inside that class create functions that handles when a player holds down a key and then another function that handles when a player stops pressing the key. Here is an example:

function Drone:MoveForward()
	self.drone.MovingForward.Value = true
	if self.speedForward < 1 then
		self.speedForward = 1
	end
	while self.drone.MovingForward.Value do
		self.speedForward += self.droneSpeed
		self.linearVelocity.VectorVelocity = Vector3.new(self.speedForward, self.speedUp, 0)
		task.wait(.1)
	end
end

function Drone:MoveForwardOff()
	self.drone.MovingForward.Value = false
	while self.speedForward > 0  and not self.drone.MovingForward.Value do
		self.speedForward -= self.droneSpeed
		self.linearVelocity.VectorVelocity = Vector3.new(self.speedForward, self.speedUp, 0)
		task.wait(.1)
	end
end
1 Like

ty! I’ll keep this in mind

[for words]