OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 24 Aug 2016 03:17 PM |
How can I make it smoothly turn to a brick?
I know to make them just instantly turn is something like
CFrame.new(torso.CFrame.p,part.CFRame.p) or something like that, but how do I make them smoothly turn?
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 03:18 PM |
body gyro...
also lerp from StartCFrame to EndCFrame with alpha 0-1 |
|
|
| Report Abuse |
|
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 24 Aug 2016 03:20 PM |
How do BodyGyros work? I just see the maxforce values in it.
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 03:20 PM |
| do you ever use the wiki D is ####### # ## force |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 03:21 PM |
screw chat filtering find it out yourself |
|
|
| Report Abuse |
|
|
2eggnog
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 1351 |
|
|
| 24 Aug 2016 03:21 PM |
You set the CFrame of a BodyForce to one of the desired rotation.
|
|
|
| Report Abuse |
|
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 24 Aug 2016 05:07 PM |
BodyGyro doesn't work, tried this parented to torso
script.Parent.BodyGyro.cframe = CFrame.new(script.Parent.Position, workspace.Part.Position)
(script.Parent is Torso)
|
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 24 Aug 2016 05:11 PM |
Well bodygyro is about locking the rotation of an object to a place or make it rotate to it, you may have seen it in the wobbly plates in sword fights on the height's if you bothered checking their scripts.
http://wiki.roblox.com/index.php?title=API:Class/BodyGyro
Check the CFrame property. |
|
|
| Report Abuse |
|
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 24 Aug 2016 05:13 PM |
Yes I saw. That's what i'm trying to do.
I used the example and it did not work. I tried it on a characters torso.
|
|
|
| Report Abuse |
|
|
OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 24 Aug 2016 05:14 PM |
To clarify, it did nothing and no output. I also tried upping D and P and maxTorque
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 05:36 PM |
...
gyro = Instance.new("Gyro", namehere.Torso) while wait() do gyro.cframe = CFrame.new(gyro.Parent.Position, part.Position) end simple |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Aug 2016 06:07 PM |
| you COULD use that but tbh this is faster |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 06:10 PM |
local orig = torso.CFrame for index = 0, 1, 0.01 do --change 0.01 to the increment; must be between 0-1. 0.1 is 10 frames, 0.2 is 5, etc. --the more frames, the smoother it is. 0.01 is 100 frames. torso.CFrame = orig:lerp(CFrame.new(torso.CFrame.p, CFrame.new(part.CFrame.X, torso.CFrame.Y, part.CFrame.Z).p), Index) wait() end torso.CFrame = CFrame.new(torso.CFrame.p, CFrame.new(part.CFrame.X, torso.CFrame.Y, part.CFrame.Z).p) --to fix floating point errors, if any
There are probably errors in those and it might not work; I didn't test it. It's just an example. But I think it might, idk.
"me caveman rawr" - Me |
|
|
| Report Abuse |
|
|