#Mobile Cam Not Working
17 messages · Page 1 of 1 (latest)
local hover = "rbxassetid://17289011155"
local fly = "rbxassetid://17289013316"
local WindSoundEnabled = true
local BodyVelocity = script:WaitForChild("BodyVelocity"):Clone()
local v3 = script.BodyGyro:Clone()
local Character = script.Parent
local Humanoid = Character:FindFirstChild("Humanoid") or Character:WaitForChild("Humanoid")
BodyVelocity.Parent = Character
v3.Parent = Character
local Hover = Instance.new("Animation")
Hover.AnimationId = hover
local Fly = Instance.new("Animation")
Fly.AnimationId = fly
local Sound1 = Instance.new("Sound", Character.HumanoidRootPart)
Sound1.SoundId = "rbxassetid://"
Sound1.Name = "Sound1"
if WindSoundEnabled == false then
Sound1.Volume = 0
end
local v10 = Humanoid.Animator:LoadAnimation(Hover)
local v11 = Humanoid.Animator:LoadAnimation(Fly)
local Camera = game.Workspace.Camera
local function u2()
if Humanoid.MoveDirection == Vector3.new(0, 0, 0) then
return Humanoid.MoveDirection
end
local v12 = (Camera.CFrame * CFrame.new((CFrame.new(Camera.CFrame.p, Camera.CFrame.p + Vector3.new(Camera.CFrame.lookVector.x, 0, Camera.CFrame.lookVector.z)):VectorToObjectSpace(Humanoid.MoveDirection)))).p - Camera.CFrame.p;
if v12 == Vector3.new() then
return v12
end
return v12.unit
end
local Flymoving = script.Flymoving
local TweenService = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")
local Flying = true
game:GetService("RunService").RenderStepped:Connect(function()
if script.Parent == Character then
if Flying == true then
Humanoid:ChangeState(6)
v3.CFrame = game.Workspace.Camera.CFrame
if u2() == Vector3.new(0, 0, 0) then
Flymoving.Value = false
else
Flymoving.Value = true
end
TweenService:Create(BodyVelocity, TweenInfo.new(0.3), {Velocity = u2() * 115}):Play()
end
end
end)
local xractivated = false
if Character:FindFirstChild("HumanoidRootPart") then
v10:Play(0.1, 1, 1)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Running, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall, false)
Character.HumanoidRootPart.Running.Volume = 0
Humanoid:ChangeState(6)
BodyVelocity.Parent = Character.HumanoidRootPart
v3.Parent = Character.HumanoidRootPart
end
To add mobile support to your Roblox flying script, you need to handle user input from mobile devices. In Roblox, the UserInputService service provides the tools to detect and handle input from various devices, including mobile devices.
ill dm you a copy of your code except when the player on mobile double jumps they active the flying
okay
but also you should make a acutaly button for mobile
what im attempting
is auto fly
like always flying
its a roblox studio sandbox type game
yeah
okay
check dms