Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Are there any good tutorials on Interpolate?

Asked by 9 years ago

Hello, I've been seeing Interpolatea lot and just checked it out on the wiki:

Description: Smoothly tweens the camera from the current coordinate frame to the supplied one with the given focus over the duration. Member of: Camera

I want to learn about this, it would go great with my game! Are there any good tutorials, or could anyone explain it?

1 answer

Log in to vote
1
Answered by 9 years ago

Well, you just sparked my interest in it. After some toying around and bouncing between Studio and the wiki, it seems that for: Camera:Interpolate(Position, Direction, Time), the Camera specified will move to Position, then swing around to face Direction, all as a fluid motion over Time seconds. Things to remember are that Position and Direction are CFrame values, not Vector3 ones. so if you want the camera to move to a certain brick's position and face toward its front your would write:

Camera:Interpolate(Brick.CFrame, Brick.CFrame + Vector3.new(Brick.Rotation), 5)
-- this take 5 seconds. Also note that the rotation of a brick has to be added in (for some reason, don't know why).
0
Thanks! BosswalrusTheCoder 88 — 9y
Ad

Answer this question