How would I make a submarine?

  1. What do you want to achieve?

A simple submarine that moves up and down, can rotate left and right, and move forward and backwards. I have tried using VehicleSeats but I am not sure how I can detect when the player presses “E” or “Q” with that method.

You would use UserInputService: UserInputService

You can check when the player uses E using the follow code:
local UIS = game:GetService(“UserInputService”)

local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(key) -- Detects an input
	
	if key.KeyCode == Enum.KeyCode.E then -- Checks to see if the player is pressing E
		
		print("Player pressed E.")
		
	end
	
end)

ContextActionService seems like a better pick to me.

2 Likes

Both work, it just depends on your preference.

1 Like

Thanks for the help, I ended up using both of the methods and this is how it turned out.

3 Likes