jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 12:09 AM |
I will give 50 R$ to who ever can help me properly.
I need a script that will lock my characters camera behind him and will rotate with him. so if I flipped my character at a 45 degree the camera will flip 45 degrees. Any degree in all directions. |
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
| |
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 01:01 AM |
local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:wait() local rootPart = character:WaitForChild("HumanoidRootPart") local camera do workspace.Changed:connect(function() camera = workspace.CurrentCamera end) camera = workspace.CurrentCamera end
game:GetService("RunService").RenderStepped:connect(function() camera.CameraType = Enum.CameraType.Scriptable camera.CoordinateFrame = rootPart.CFrame - rootPart.CFrame.p+ rootPart.CFrame*Vector3.new(0,1.5,10) end)
To test, make the humanoid platform stand. |
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 01:13 AM |
| problem. dosnt seem to be working. would it help to say my character dosnt have a humanoidrootpart, i changed it to Head but it didnt work. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 01:14 AM |
| Output? Works fine for me. Only issue is that you can't really walk backwards unless you want to write a custom controller. |
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 01:17 AM |
| Camera is not a valid member of workspace |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 01:21 AM |
Quick list: It should be a local script. It should be in the playergui or backpack. Are you using a custom character? Otherwise there is a HumanoidRootPart (does not show up in explorer, but it is there) Can you post the code you tried to run? Because my code cannot produce that error since I always index workspace.CurrentCamera (which would return nil or the camera since it is a property of workspace and I am not actively trying to index an object).
|
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 01:24 AM |
You can test it here: http://www.roblox.com/jordo-Camera-place?id=229167095
|
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 01:25 AM |
Worked once i changed it to follow head and also put in gui, Thx, i havnt played roblox since 2010 how do i give you reward
|
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 01:35 AM |
local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:wait() local rootPart = character:WaitForChild("HumanoidRootPart") local humanoid = character:WaitForChild("Humanoid") local mouse = player:GetMouse() mouse.KeyDown:connect(function(key) if key:lower() == 's' then humanoid.AutoRotate = false repeat until mouse.KeyUp:wait():lower() == 's' humanoid.AutoRotate = true end end) local camera do workspace.Changed:connect(function() camera = workspace.CurrentCamera end) camera = workspace.CurrentCamera end
game:GetService("RunService").RenderStepped:connect(function() camera.CameraType = Enum.CameraType.Scriptable camera.CoordinateFrame = rootPart.CFrame - rootPart.CFrame.p+ rootPart.CFrame*Vector3.new(0,1.5,10) end)
Fixed the backwards walk in case anyone else needs it. |
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 01:58 AM |
it seams when you die and respawn your camera dosnt
|
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 02:11 AM |
| Can you post the tweaked code? My guess is you moved the CameraType line outside of the renderstepped loop (I know guys, it is not actually a loop). This was to purposely placed to prevent the player respawn code to override the camera settings. |
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 02:22 AM |
local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:wait() local rootPart = character:WaitForChild("Head") local camera do workspace.Changed:connect(function() camera = workspace.CurrentCamera end) camera = workspace.CurrentCamera end
game:GetService("RunService").RenderStepped:connect(function() camera.CameraType = Enum.CameraType.Scriptable camera.CoordinateFrame = rootPart.CFrame - rootPart.CFrame.p+ rootPart.CFrame*Vector3.new(0,1.5,10) end)--thx Casualist |
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
| |
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 02:28 AM |
local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:wait() print("Character found") local rootPart = character:WaitForChild("Head") print("Head found") local camera do workspace.Changed:connect(function() camera = workspace.CurrentCamera end) camera = workspace.CurrentCamera end print(player, Character, rootPart, camera) print("Hooking up camera") game:GetService("RunService").RenderStepped:connect(function() camera.CameraType = Enum.CameraType.Scriptable camera.CoordinateFrame = rootPart.CFrame - rootPart.CFrame.p+ rootPart.CFrame*Vector3.new(0,1.5,10) end)
Mind running this for diagnostics? Also is there a place I can test the error? It may have something to do with how you handle custom character creation. |
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 02:31 AM |
Character found Head found Player1 nil Head Camera Hooking up camera Character found Head found Player1 nil Head Camera Hooking up camera |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 02:34 AM |
| lol, I capitalized character on accident. And that is that the output when you experience the glitch of the camera not respawning with the player? |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
| |
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 02:36 AM |
ya, i put character lowercase and it dosnt have an error it just dosnt connect Character found Head found Player1 Player1 Head Camera Hooking up camera Character found Head found Player1 Player1 Head Camera Hooking up camera is all it puts
|
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 02:39 AM |
Is there a server I can test this on? If it is getting to the Hooking up camera line, it must be connecting.
Just a thought, since you are using custom characters it might be picking up the old character before you create a new one. |
|
|
| Report Abuse |
|
|
jordo
|
  |
| Joined: 13 Apr 2007 |
| Total Posts: 265 |
|
|
| 22 Mar 2015 02:40 AM |
| my 15 place is the only on that has it |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 02:42 AM |
local player = game:GetService("Players").LocalPlayer local character do player.CharacterAdded:connect(function() character = player.Character end) character = player.Character or player.CharacterAdded:wait() end
local camera do workspace.Changed:connect(function() camera = workspace.CurrentCamera end) camera = workspace.CurrentCamera end
game:GetService("RunService").RenderStepped:connect(function() local rootPart = character:FindFirstChild("Head") if not rootPart then return end camera.CameraType = Enum.CameraType.Scriptable camera.CoordinateFrame = rootPart.CFrame - rootPart.CFrame.p+ rootPart.CFrame*Vector3.new(0,1.5,10) end)--thx Casualist |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 22 Mar 2015 02:44 AM |
| Your game is friends only at the moment |
|
|
| Report Abuse |
|
|