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

How to tween the camera in as a result of touching a brick?

Asked by 5 years ago

How would I make it so that when a player touches a brick, their camera focuses in on (tweens to) an NPC? Although when they are no longer touching the brick, their camera resumes to its normal state...?

0
Use this https://www.youtube.com/watch?v=ZZdZDcYIxCg but make sure you change the script to an On Touched event! tightanfall 110 — 5y

1 answer

Log in to vote
1
Answered by
metryy 306 Moderation Voter
5 years ago
Edited 5 years ago

You can use the "Touched" event that is an event of every part in the game that fires when another part touches said part. With the event, you can connect a function to it that sets the Camera property to scriptable and uses the Lerp function to animate the camera.

Helpful resources:

https://developer.roblox.com/api-reference/event/BasePart/Touched - The Touched event

https://developer.roblox.com/articles/Lerp - The Lerp function

Ad

Answer this question