Ok, so I have a part that appear when you click “V” on your keyboard, its a copy of your head I removed eveyrthing in it and in a local script I add a humanoidrootpart and a humanoid and in the rootpart thers and attachment and vectorforce and it locks your mouse and orients the part when you move your mouse so if your looking down and press “W” and want it to move in that direction
local speedup = 1
local boolr = false
local booly = false
local boolf = false
local boolt = false
local boolg = false
local boolh = false
local boole = false
local boolq = false
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.W and drex then
boolt = true
while boolt do
wait(.02)
drone.CFrame *= CFrame.new(game.Workspace.Camera.CFrame.LookVector.X * speedup,0,game.Workspace.Camera.CFrame.LookVector.Z * speedup)
end
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.W and drex then
boolt = false
end
end)
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.S and drex then
boolg = true
while boolg do
wait(.02)
drone.CFrame *= CFrame.new(-game.Workspace.Camera.CFrame.LookVector.X * speedup ,0,-game.Workspace.Camera.CFrame.LookVector.Z * speedup)
end
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.S and drex then
boolg = false
end
end)
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.E and drex then
boole = true
while boole do
wait(.02)
drone.CFrame *= CFrame.new(0,0.6 * speedup,0)
end
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.E and drex then
boole = false
end
end)
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and drex then
boolq = true
while boolq do
wait(.02)
drone.CFrame *= CFrame.new(0,-0.6 * speedup,0)
end
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and drex then
boolq = false
end
end)
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift and drex then
speedup = 10
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift and drex then
speedup = 1
end
end)
That’s strange a bit because i had everything ok with this.
Can you send a vidio with it? btw it can be because your camera script have small offset to the left.
mouse.Move:Connect(function()
if mouse.Hit.p ~= prev_mousehit then
vrhead.CFrame = CFrame.new(vrhead.Position, Vector3.new(mouse.Hit.p.X,mouse.Hit.p.Y,mouse.Hit.p.Z))
prev_mousehit = mouse.Hit.p
end
end)
local boolt = false
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W then
boolt = true
while boolt do
wait(0.02)
vrhead.CFrame *= CFrame.new(game.Workspace.Camera.CFrame.LookVector.X * 1,0,game.Workspace.Camera.CFrame.LookVector.Z * 1)
end
end
end)
uis.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W then
boolt = false
end
end)
Mb the problem because it is setting CFrame twice?
mouse.Move:Connect(function()
if mouse.Hit.p ~= prev_mousehit then
vrhead.CFrame = CFrame.new(vrhead.Position, Vector3.new(mouse.Hit.p.X,mouse.Hit.p.Y,mouse.Hit.p.Z))
prev_mousehit = mouse.Hit.p
end
end)
try to select and and press control + / and then test
Edit:
I guess the problem is not there.
Mb it is because you have shiftlock or smth?
So the problem that was before fixed?
If the previous problem is fixed try to create a bool variable and in check if the variable is true
and set this variable to false if InputBegan and set the variable to false if the InputBegan.
local CheckBool = true
mouse.Move:Connect(function()
if mouse.Hit.p ~= prev_mousehit and CheckBool == true then
vrhead.CFrame = CFrame.new(vrhead.Position,Vector3.new(mouse.Hit.p.X,mouse.Hit.p.Y,mouse.Hit.p.Z))
prev_mousehit = mouse.Hit.p
end
end)
local boolt = false
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W then
CheckBool = false
boolt = true
while boolt do
wait(0.02)
vrhead.CFrame *= CFrame.new(game.Workspace.Camera.CFrame.LookVector.X * 1,0,game.Workspace.Camera.CFrame.LookVector.Z * 1)
end
end
end)
uis.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W then
CheckBool = true
boolt = false
end
end)
Oh i guess i got why it happen wait a bit ;-;
Also you can delete previous check with CheckBool.
local cam = game.Workspace.Camera
mouse.Move:Connect(function()
if mouse.Hit.p ~= prev_mousehit then
vrhead.CFrame = CFrame.new(vrhead.Position,Vector3.new(cam.CFrame.LookVector.X,cam.CFrame.LookVector.Y,cam.CFrame.LookVector.Z) + vrhead.Position )
prev_mousehit = mouse.Hit.p
end
end)
local boolt = false
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W then
boolt = true
while boolt do
wait(0.02)
vrhead.Position += Vector3.new(cam.CFrame.LookVector.X * 1,0,cam.CFrame.LookVector.Z * 1)
end
end
end)
uis.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W then
boolt = false
end
end)
local cam = game.Workspace.Camera
mouse.Move:Connect(function()
if mouse.Hit.p ~= prev_mousehit then
vrhead.CFrame = CFrame.new(vrhead.Position,Vector3.new(cam.CFrame.LookVector.X,cam.CFrame.LookVector.Y,cam.CFrame.LookVector.Z) + vrhead.Position )
prev_mousehit = mouse.Hit.p
end
end)
local boolt = false
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W then
boolt = true
while boolt do
wait(0.02)
vrhead.CFrame *= CFrame.new(game.Workspace.Camera.CFrame.LookVector.X * 1,0,game.Workspace.Camera.CFrame.LookVector.Z * 1)
end
end
end)
uis.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W then
boolt = false
end
end)