You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
When the player is sent to the baseplate where they need to dodge bullets, I want the player to be able to move. -
What is the issue? Include screenshots / videos if possible!
Whenever I change the camera (not teleport, not set walkspeed) to the camera that’s dirrected at the baseplate, the player can’t move -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried changing my camera code. I wanted to see what happens if I set the camera to the camere I use during battle (not while the player is dodging) and setting my walkspeed to 20 there, and I am able to move.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
The only time I’m able to move in my code is when I remove the line of code that changes my camera to “AttackCameraPart”. But when I replace it with “CameraPart”, I can move just fine?
CameraScript:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local CurrentCamera = workspace.CurrentCamera
local ChangeCamera = ReplicatedStorage.ChangeCamera
local RunStep = true
CurrentCamera.CameraSubject = humanoidRootPart
CurrentCamera.CameraType = Enum.CameraType.Attach
local function updateCamera()
if RunStep then
CurrentCamera.CFrame = CFrame.new(humanoidRootPart.Position) * CFrame.new(0, 15, 20) * CFrame.Angles(math.rad(-40), 0, 0)
end
end
RunService.Stepped:Connect(updateCamera)
ChangeCamera.OnClientEvent:Connect(function(cameraName)
if cameraName ~= "Player" then
RunStep = false
CurrentCamera.CameraType = Enum.CameraType.Scriptable
CurrentCamera.CFrame = workspace:WaitForChild(cameraName).CFrame
else
RunStep = true
CurrentCamera.CameraType = Enum.CameraType.Attach
end
end)
Code where I change camera and walkspeed:
Humanoid.WalkSpeed = 20
task.wait(1)
ChangeCamera:FireClient(player, "AttackCameraPart")
local turnLength = 10
IdleAnim:Stop()
MagicAnim:Stop()
if player.Character:FindFirstChild("ClassicSword") then
player.Character.ClassicSword.Parent = player.Backpack
end
player.Character:MoveTo(workspace.BattleBaseplate.Position + Vector3.new(0, 3, 0))
Here’s a video of it:
(When I’m teleported back to where I choose something on my turn, I’m using the same camerascript and using “CameraPart” rather than “AttackCameraPart”)