|
| 30 Jan 2015 07:50 AM |
I'm calling LoadCharacter through a RemoteEvent, however, before this, the CameraType is set to Scriptable.
When LoadCharacter is called, the player dissapears but the camera stays the same. In a localscript, I have set the CameraType back to Custom. The problem is that the camera won't go back to the player.
Can anybody see a reason why this isn't working properly (In Online mode)? --------
LoadCharacter: game.ReplicatedStorage.RemoteEvents.TeamChanger.OnServerEvent:connect(function(player, team) player.TeamColor = game.Teams[team].TeamColor player:LoadCharacter() end) --------
LocalScript, Change Team: game.ReplicatedStorage.RemoteEvents.TeamChanger:FireServer("Raiders") --------
LocalScript, Camera: Player = game.Players.LocalPlayer cam = game.Workspace.CurrentCamera repeat wait() until Player.Character cam.CameraType = "Custom"
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
tbnj123
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 443 |
|
|
| 30 Jan 2015 11:18 AM |
| cam.CameraSubject = Player.Character.Humanoid |
|
|
| Report Abuse |
|
|
Aceylos
|
  |
| Joined: 26 Feb 2010 |
| Total Posts: 8266 |
|
|
| 30 Jan 2015 11:40 AM |
I'm assuming the location of this script is PlayerGui? If so the script is being removed/reset when you call :LoadCharacter() before it has a chance to set the camera back.
- Ace |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2015 11:41 AM |
| It would still run the code again, even if it was reset. |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2015 12:54 PM |
Just a guess, but when you fire this:
game.ReplicatedStorage.RemoteEvents.TeamChanger.OnServerEvent:connect(function(player, team) player.TeamColor = game.Teams[team].TeamColor player:LoadCharacter() end)
Before firing LoadCharacter, set CameraType to it's default, then set CameraSubject to the Humanoid.
So
game.ReplicatedStorage.RemoteEvents.TeamChanger.OnServerEvent:connect(function(player, team) player.TeamColor = game.Teams[team].TeamColor --Default CameraType --CameraSubject = player.Character.Humanoid player:LoadCharacter() end)
You can pick you method of doing this. |
|
|
| Report Abuse |
|
|