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: Locking the camera to a brick/smooth FPV view?

Previous Thread :: Next Thread 
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 03:36 PM
God, I hate manipulating the camera.

Tried rapidly setting the camera's subject and CFrame, but the physics engine runs @ 60 FPS, and I'm pretty sure scripts run @ 30 FPS. This caused the camera to have an absolute spaz attack.

I was playing 'Innovation Experimental Test Site' earlier today, and they're FPV works fine without shaking.

So, what's the secret?


jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
02 Feb 2015 03:38 PM
RunService.RenderStepped fires 60 times per second at peak.

It only works well when you are using it on the character or on a position managed locally, because of latency and packet loss and stuff. So if you are setting the position to a brick that is managed on the server, it will still be jumpy.
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 03:41 PM
Oh, so I have to use it with local parts as my focus and CFrame?

*continues to switch back to studio and scrambles to write local part script with 64 typos*

Wait, what'll be moving the points? Should I base the position of the CFrame and Focus off the sitting character?


jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
02 Feb 2015 04:01 PM
I would just base them off of the character.
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 04:03 PM
"I would just base them off of the character."

I did that, and the camera had a massive flip.

Didn't wanna leave 0,0,0.


function LockCamera()
local FocusOn = Instance.new("Part", cam)
FocusOn.CanCollide = false
FocusOn.Anchored = false
FocusOn.Transparency = 1

while wait() do
FocusOn.Position = (plr.Character.Head.CFrame.lookVector * 5)

cam.CameraSubject = FocusOn
cam.CoordinateFrame = CFrame.new(plr.Character.Head.CFrame.lookVector * 2)

if active == false then
break
end

end
FocusOn:Destroy()
end


jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 05:38 PM
b1

jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 06:00 PM
b2

jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
02 Feb 2015 06:06 PM
That is completely wrong.

Creating a new CFrame without setting the angles will always face in the same direction.
Don't create a CFrame based on lookVectors, unless you really know why you need it.

CameraSubject is ignored when you use a Scriptable camera.

Oh, were you even using a Scriptable camera? I recommend using that, just because it is far easier to work with IMO.


I would guide you for your CFrames, but I didn't understand what you wanted for them.
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 06:10 PM
I've altered the script so much by now that it barely resembles what it used to by now.

"CameraSubject is ignored when you use a Scriptable camera."

I think that may be my problem right there.

That and using lookVectors.


jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 06:36 PM
I've changed the script to only use local parts now, but the camera still shakes violently and actually dips below the baseplate when I go into a turn.


function LockCamera()
while wait() do
cam.CameraType = Enum.CameraType.Scriptable
cam.CoordinateFrame = plr.Character.Head.CFrame + plr.Character.Torso.Rotation

if active == false then
break
end

end
end



jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
02 Feb 2015 06:51 PM
b3

jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
03 Feb 2015 06:33 AM
b4

jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
03 Feb 2015 06:43 AM
cam.CoordinateFrame = CFrame.new(plr.Character.Head.CFrame, plr.Character.Torso.CFrame.lookVector)

If you would like it smooth:

cam:Interpolate(plr.Character.Head.CFrame, plr.Character.Torso.CFrame.lookVector, 1)

http://wiki.roblox.com/index.php?title=API:Class/Camera/Interpolate
Report Abuse
CodeNil is not online. CodeNil
Joined: 22 Jul 2013
Total Posts: 23
03 Feb 2015 06:53 AM
function LockCamera()
cam.CameraType = Enum.CameraType.Scriptable
local RenderStepped = game:GetService("RunService").RenderStepped
while RenderStepped:wait() do
cam.CoordinateFrame = plr.Character.Head.CFrame + plr.Character.Torso.Rotation

if active == false then
break
end

end
end
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
03 Feb 2015 06:55 AM
It behaves smoothly, but faces 0,0,0.

I'll make an attempt to fix it.

Also, had to cover up the "lookVector" bit with CFrame.new.


function LockCamera()
while wait() do
cam.CameraType = Enum.CameraType.Scriptable
-- cam.CoordinateFrame = plr.Character.Head.CFrame + plr.Character.Torso.Rotation

cam:Interpolate(plr.Character.Head.CFrame, CFrame.new(plr.Character.Torso.CFrame.lookVector), 1)

if active == false then
break
end

end
end



jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
03 Feb 2015 07:02 AM
Fire Interpolate on a Heartbeat wi a duration of 1/15

It's smooth and can be based off things like other characters (stuff not local)
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
03 Feb 2015 07:09 AM
@Code

All that did was ENSURE the camera didn't move - it just stopped working.

In other words, the vehicle left me behind.


jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
LogicClock is not online. LogicClock
Joined: 07 Feb 2012
Total Posts: 190
03 Feb 2015 08:50 AM
lol kid just get a dev to make it for you...
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
03 Feb 2015 03:41 PM
Here's the place, to show you what happens:

http://web.roblox.com/Train-Building-place?id=111006746


jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
03 Feb 2015 07:05 PM
b6

jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
04 Feb 2015 06:13 AM
b7

jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
04 Feb 2015 04:52 PM
b8

jeb get me the seperatrons | go get hit by a speeding commuter train
Report Abuse
Astrain1 is not online. Astrain1
Joined: 27 Mar 2013
Total Posts: 18697
05 Feb 2015 06:29 AM
b9

jeb get me the seperatrons | go get hit by a speeding commuter train
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