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 » Scripters
Home Search
 

Re: script not working, looks fine though, please help

Previous Thread :: Next Thread 
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
16 Apr 2016 09:38 AM
--when i move my camera is supposed to make some fluid movement left to right



local d = 2
local s = 7

game:GetService("RunService").Stepped:connect(function()
local cam = workspace.CurrentCamera

cam.CoordinateFrame = cam.CoordinateFrame
* CFrame.Angles(0,0,
math.rad( d * math.sin( tick() * s ) )
)
end


--what did i do wrong? please help
Report Abuse
ebm4321 is not online. ebm4321
Joined: 09 Jan 2012
Total Posts: 74
16 Apr 2016 10:03 AM
replace that end with a end)
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
17 Apr 2016 10:37 PM
Yeah i noticed i forgot the ")" but i think it has to do with "Stepped:connect(function()" i dont think it knows im trying to make the camera move when i move forward

help please
Report Abuse
Darkenus is not online. Darkenus
Joined: 17 Jul 2014
Total Posts: 1997
17 Apr 2016 11:45 PM
make sure its a localscript.

im pretty sure the connection part and the code is solid and good.

maybe its your math?
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 12:26 AM
Yeah its a local script but everything there looks fine, it just doesnt seem to understand that when a player moves the camera is suppose to move < >

it has to be around Stepped:conncent(funtion()


someone help
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 12:36 AM
Hmm i tried doing this



local d = 2
local s = 7


function onRunning(speed)
while true do
local cam = workspace.CurrentCamera
cam.CoordinateFrame = cam.CoordinateFrame
* CFrame.Angles(0,0,
math.rad( d * math.sin( tick() * s ) )
)
end
end


there were no errors in output, script is local, it just isnt working, someone please help!
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 12:51 AM
okay so basically im trying to make it to where when a player moves and keeps moving the camera constantly moves left to right just for a little realism in FPS mode.


someone please help!
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 01:07 AM
im sorry for spamming i really need help
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 02:13 AM
help
Report Abuse
Thy_Yuno is not online. Thy_Yuno
Joined: 15 Jul 2014
Total Posts: 239
18 Apr 2016 02:28 AM
heeeeellpppp
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 02:45 AM
aw come on dude why, why must thy trolleth me
Report Abuse
Brick_Wizard is not online. Brick_Wizard
Joined: 15 Mar 2016
Total Posts: 2072
18 Apr 2016 04:24 AM
Is it disabled?


Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 04:57 AM
no its not, its not a local script either!
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 10:03 AM
please help me people!
Report Abuse
earthyreuben is not online. earthyreuben
Joined: 17 Jan 2010
Total Posts: 669
18 Apr 2016 10:17 AM
Use renderstepped
Report Abuse
earthyreuben is not online. earthyreuben
Joined: 17 Jan 2010
Total Posts: 669
18 Apr 2016 10:19 AM
What exactly is going on? The camera isn't moving?
Report Abuse
earthyreuben is not online. earthyreuben
Joined: 17 Jan 2010
Total Posts: 669
18 Apr 2016 10:23 AM
Add this line:
cam.CameraType = Enum.CameraType.Scriptable;
Report Abuse
johnville is not online. johnville
Joined: 12 Oct 2008
Total Posts: 388
18 Apr 2016 10:01 PM
no the camera does not move (left and right) when its supposed to -- when i move




also even after adding the line the script still doesnt know what im trying to say but i understand what i kind of missed.



so im trying to make it to where when the player moves forward the camera function takes place
Report Abuse
earthyreuben is not online. earthyreuben
Joined: 17 Jan 2010
Total Posts: 669
18 Apr 2016 11:13 PM
leaning up your code a bit:

local d = 2;
local s = 7;

local cam = workspace.CurrentCamera;
cam.CameraType = Enum.CameraType.Scriptable;

game:GetService("RunService").RenderStepped:connect(function()
cam.CoordinateFrame = cam.CoordinateFrame *
CFrame.Angles(0, 0, math.rad(d*math.sin(tick()*s)));
end)


It moves, but doesn't follow the player. Up to you to fix it the way you like.
Report Abuse
earthyreuben is not online. earthyreuben
Joined: 17 Jan 2010
Total Posts: 669
18 Apr 2016 11:19 PM
I wrote this earlier, but you can use t if you want. Not quite done with it yet (to my standards at least)

local camera = game.Workspace.CurrentCamera;
camera.CameraType = Enum.CameraType.Scriptable;

repeat
wait()
until game.Players.LocalPlayer.Character;

local char = game.Players.LocalPlayer.Character;

game:GetService("RunService").RenderStepped:connect(function()
local camPos = char.Head.CFrame * CFrame.new(0,3,10);
camera.CoordinateFrame = CFrame.new(camPos.p, char.Head.CFrame.p);
end)
Report Abuse
Brick_Wizard is not online. Brick_Wizard
Joined: 15 Mar 2016
Total Posts: 2072
18 Apr 2016 11:26 PM
Its not a local script... Thats why..


Report Abuse
Thy_Yuno is not online. Thy_Yuno
Joined: 15 Jul 2014
Total Posts: 239
18 Apr 2016 11:37 PM
@Brick

"there were no errors in output, *******script is local*******, it just isnt working, someone please help!"

I thought people in PB are supposed to be smart?
Report Abuse
Brick_Wizard is not online. Brick_Wizard
Joined: 15 Mar 2016
Total Posts: 2072
18 Apr 2016 11:46 PM
@Thy "no its not, its not a local script either!" I thought scripters could read....


Report Abuse
Thy_Yuno is not online. Thy_Yuno
Joined: 15 Jul 2014
Total Posts: 239
19 Apr 2016 06:38 AM
I read the main thread topic, not the other posts
Report Abuse
Unravaled is not online. Unravaled
Joined: 18 Jul 2011
Total Posts: 1117
19 Apr 2016 07:05 AM
PB ~= Smart, was a BoD there.

But on topic, as the others have said, I don't see an issue.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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