both.
Using code, I set the subject to the drive part and position + rotation to the camera part.
both.
Using code, I set the subject to the drive part and position + rotation to the camera part.
oh so u are the changing the cameras position by code? are u using cframes?
and is the truck moving by code or u are controlling it?
and does this camera glitch happen like if the truck moves a specific way?
Yes.
I am.
When its rotated in a specific angle.
hmm, so if u are controlling it, does it happen when u click A, or D? and could i see the code u are controlling the truck
and if i didnt hear correctly that u are controlling the truck, and the truck is being moved by code then could u show me the code for the truck moving?
and also if i cant fix any option i think u can also weld the camera to the truck it might workā¦
i have to also go in 5 minutes, so i will try my best to make this fast
If rotated to the specific angle.
Its a car that uses A-Chassis by INSPARE.
I welded it in a specific part.
the car movement here isnt the issue theres an issue with the camera, there might be happening some interaction or something else, iād recommend u start debugging so u can see what is happening behind the code more likely u have to print or other stuff, thats the only thing i can help you with, i will need some code if u want me to help
Well in the first video I highlighted the camera so you can see its propertiesā¦
hmm, from what i can seeā¦ ur camera seems to orientating like upside, tho iād give u this suggestion.
iād suggest u use a part instead of like manipulating the real camera, so once u create the part u can basically then just set ur normal camera to that specific part
edit: also can u also show me the code of the truck and camera, like whats happening behind the scenes when the truck moves? so i can like debug and see whats going on
Technically, I do thatā¦
script.Parent.Changed:Connect(function()
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CameraSubject = game.Workspace
game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 0
task.wait()
while script.Parent.Enabled == true do
local Camera = workspace.Camera
local pos = Vector3.new(workspace["DAF XF"].Body.hiercam.Position.X,workspace["DAF XF"].Body.hiercam.Position.Y,workspace["DAF XF"].Body.hiercam.Position.Z)
local x = workspace["DAF XF"].Body.hiercam.Rotation.X
local y = workspace["DAF XF"].Body.hiercam.Rotation.Y-180
local z = 0
task.wait()
Camera.CFrame = CFrame.new(pos) * CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))
end
end)
2.now that i see ur actually changing the āworkspace.Cameraā which is not what i was saying.What i meant was that u create a part named āTruckCameraā or literally anything else and then u set the āworkspace.Cameraā value to the truckcamera value
If itās flipping when you rotate to any multiple of 90 degrees it sounds like itās caused by āgimbal lockā. There are quite a few posts about it on the forums if you search and they explain it in easy to understand language.
Basically when you rotate to 90 degrees on the Y axis you are aligning it to the X or Z axes and it causes inputs to flip the item.
why do you want the camera to change use cameratype.follow or math.clamp it
Fixed this issue using this:
script.Parent.Changed:Connect(function()
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CameraSubject = game.Workspace
game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 0
task.wait()
while script.Parent.Enabled == true do
local Camera = workspace.CurrentCamera
task.wait()
Camera.CFrame = workspace["DAF XF"].Body.hiercam.CFrame
end
end)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.