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: Making the Camera interpolate to a new position?

Previous Thread :: Next Thread 
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
23 Mar 2016 10:38 AM
How can I make:
1. The Player's camera interpolated from it's current position/view to another certain view-point. For example, when a car is clicked, interpolated to look through the windscreen.

2. The camera go instantly back to the default camera view? For example, when a button is clicked to exit the car, do this.

Any help or advise would be greatly appreciated.
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
23 Mar 2016 11:40 AM
Here's what I've been trying, but it isn't working.
At the moment, the camera just freezes and stays still in one position. It doesn't interpolate at all.

local cam = game.Workspace.CurrentCamera
cam.CameraType = ("Scriptable")
cam:Interpolate(game.Workspace.Part1.CFrame, game.Workspace.Part2..CFrame, 0.5)


Why is this not working as it should?
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
23 Mar 2016 11:49 AM
I'm a little confused here.

Are you trying to make a locked first person perspective from inside of the car when the player is seated?

Camera interpolation is a bit more complicated than it seems. By making it scriptable, it won't just automatically snap to the character relative to where it is, its a bit more than that.

Could you explain a bit more of what you're trying to do?
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
23 Mar 2016 12:30 PM
So this is what I'm trying to achieve:

I have a window and outside the window is a tree.
When you click on the window I want the Player's camera to pan over to the window, so CoordinateFrame = Window.CFrame, and I want the camera to focus on the tree.

I can do this by just changing the CoordinateFrame and the Focus of the Camera, but how do I make the camera will glid/interpolate over to the CFrame of the Window and focus on the tree.

When the Player want's to exit the "Window view", they click an Exit button (which I have already prepared). How can I then make the Camera return to it's default settings, so to speak?

Have I explained this well enough?
If I haven't, please just let me know.
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
23 Mar 2016 12:31 PM
*...camera will glide/interpolate over to....
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
23 Mar 2016 01:06 PM
Perhaps I should not be using:Interpolate() for this at all?
I'm relatively new to camera manipulation, so maybe I've misunderstood the concept.

Should :Interpolate() be used for this?

I would really appreciate any further help or advise.
Report Abuse
KnownEntity is not online. KnownEntity
Joined: 28 Nov 2012
Total Posts: 47
23 Mar 2016 02:33 PM
local Camera = workspace.CurrentCamera

function MoveCamera(Target, Time)
local StartTime, Origin = tick(), Camera.CoordinateFrame

repeat
Camera.CoordinateFrame = Origin:lerp(Target, math.sin(((tick()-StartTime)/Time)*1.57))
game:GetService("RunService").RenderStepped:wait()
until StartTime+Time < tick()

Camera.CoordinateFrame = Target
end

This is might be what your looking for?
Report Abuse
Craftero is not online. Craftero
Joined: 24 Jun 2011
Total Posts: 1451
23 Mar 2016 04:51 PM
Thanks KnownEntity, that's exactly what I was trying to do.

I've been playing around with it for a while.
I'm now trying to make it work backwards, so to speak, so that when the "Exit" button is pressed, the camera pans back to the default view.

I can't figure out how to do it yet.
Have you got any idea?
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