generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Scripted Camera Manipulation

Previous Thread :: Next Thread 
madmen27 is not online. madmen27
Joined: 16 Feb 2014
Total Posts: 15
26 Mar 2014 07:00 PM
Alright I am using a script for manipulating camera. Since the wholel thing does not really matter I will give you the heads up. It involves many function and all functions execute nicely. Yet the Camera subject in setCamera() is not set on the char's humanoid. Its set on Default view Camera of studio. Is there are way to make this scriptable actually be attached to the player? I need the cameratype Scriptable since later on in the script I use Enums of SetRoll.

--* Setup *--
local player = game:GetService('Players').LocalPlayer;
local char = player.Character;
local workspace = game.Workspace;
local cConnect = nil;
local charisRunning = false;

--* Functions *--

function setCamera()
--player.CameraMode = Enum.CameraMode.Classic
player.CameraMode = Enum.CameraMode.LockFirstPerson
workspace.CurrentCamera.CameraSubject = char.Humanoid
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
end
Report Abuse
tangyboxhead is not online. tangyboxhead
Joined: 23 Oct 2011
Total Posts: 9437
26 Mar 2014 07:04 PM
how would I know?
Report Abuse
MECHANIZATION is not online. MECHANIZATION
Joined: 03 Jul 2013
Total Posts: 104
26 Mar 2014 07:04 PM
your doing it wrong
it goes liek this

function(cameramaipulation) = true
player.camera = manipulate = manipulate + 5 then
if else = nil then
mesage "no more"
then if player.moves.forward or .backward or .sideways then
player(kill)+5 = true nil
then workspace.nil = false then
wait (wiat 5 minutes) nil = true
then nil = workspace.lightingclonefive.things.to.move.charamera = true then
for _,v in pars is(camera) then
camera.remove.replacewith(function(manipulation)
end)
end)
end
end
end
end
end
end

Report Abuse
madmen27 is not online. madmen27
Joined: 16 Feb 2014
Total Posts: 15
26 Mar 2014 07:07 PM
Your code has errors.... -_-

Anyone can help me as I want to do minimal coding and just have a subject to be Humanoid on Scriptable camera?
Report Abuse
LightningBacon is not online. LightningBacon
Joined: 12 Nov 2013
Total Posts: 29
26 Mar 2014 07:08 PM
I thought CameraSubject default was humanoid..
Report Abuse
madmen27 is not online. madmen27
Joined: 16 Feb 2014
Total Posts: 15
26 Mar 2014 07:10 PM
It is but using the Enum Scriptable disallows for it to actually follow the Humanoid like a DefaultCamera...I just need its focus to follow with first person mode of the character....
Report Abuse
LightningBacon is not online. LightningBacon
Joined: 12 Nov 2013
Total Posts: 29
26 Mar 2014 07:12 PM
First person mode? Just use this

local cam = Workspace.CurrentCamera

cam.CameraMode = Enum.CameraMode.LockFirstPerson

It will put a player into FP mode and cannot zoom in/out
Report Abuse
madmen27 is not online. madmen27
Joined: 16 Feb 2014
Total Posts: 15
26 Mar 2014 07:13 PM
No but I need the Camera on Scriptable since I have other functions in this script that need it that way such as :setRoll()
Report Abuse
madmen27 is not online. madmen27
Joined: 16 Feb 2014
Total Posts: 15
26 Mar 2014 07:16 PM
*sigh* wholescript....

Parent script:

--* Clone Script *--
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
x = script:GetChildren()
for i = 1, #x do
x[i]:clone().Parent = c.Torso
end
end)
end)

ChildScript:

--* Setup *--
local player = game:GetService('Players').LocalPlayer;
local char = player.Character;
local workspace = game.Workspace;
local cConnect = nil;
local charisRunning = false;

--* Functions *--

function setCamera()
--player.CameraMode = Enum.CameraMode.Classic
player.CameraMode = Enum.CameraMode.LockFirstPerson
workspace.CurrentCamera.CameraSubject = char.Humanoid
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
end

function whileRunning()
game.Workspace.CurrentCamera:SetRoll(0.01)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.02)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.03)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.04)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.05)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.06)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.07)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.08)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.09)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(0.1)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.01)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.02)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.03)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.04)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.05)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.06)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.07)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.08)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.09)
wait(0.02)
game.Workspace.CurrentCamera:SetRoll(-0.1)
wait(0.02)
end

function isRunning()
if charisRunning and char.Torso.Velocity.magnitude > 1 then
return true
end
end

char.Humanoid.Jumping:connect(function()
charisRunning = false;
end)

function cRunning()
setCamera()
cConnect:disconnect();
charisRunning = true;
while (isRunning()) do
whileRunning()
wait(0)
end
charisRunning = false;
cConnect = char.Humanoid.Running:connect(cRunning);
end

cConnect = char.Humanoid.Running:connect(cRunning);
Report Abuse
madmen27 is not online. madmen27
Joined: 16 Feb 2014
Total Posts: 15
26 Mar 2014 07:22 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image