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

can I rotate a part in increments using lookvector?

Asked by 6 years ago
Edited 6 years ago

i've have a part that rotates to mouse.hit, using lookvector...

part.CFrame = CFrame.new(part.CFrame.p,mouseposition) 

however this rotates the the part instantly, is it posible to move in increment instead? could i change rotation to an angle and use a for loop maybe..

0
Use a for loop that increments using three numbers, with the third number being how much you increment, as represented by a number. DeceptiveCaster 3761 — 6y
0
Use the tweenservice User#20388 0 — 6y
0
use tweening wookey12 174 — 6y

1 answer

Log in to vote
0
Answered by
ax_gold 360 Moderation Voter
6 years ago

use game:GetService("TweenService"). It increases pretty much every number value in incraments throughout a given time, until it reaches the goal value. Here's an example with your script:

local tweenservice = game:GetService("TweenService")

loal tween = tweenservice:Create(part, TweenInfo.new(1), {["CFrame"] = CFrame.new(part.CFrame.p,mouseposition)}
tween:Play()

TweenService is kinda complicated, so I think you should read more about it at the links below:

TweenService

TweenInfo

Ad

Answer this question