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: Make a character look at a brick smoothly?

Previous Thread :: Next Thread 
OldGoldie is not online. 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
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
24 Aug 2016 03:18 PM
body gyro...

also lerp from StartCFrame to EndCFrame with alpha 0-1
Report Abuse
OldGoldie is not online. 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
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
24 Aug 2016 03:20 PM
do you ever use the wiki D is ####### # ## force
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
24 Aug 2016 03:21 PM
screw chat filtering
find it out yourself
Report Abuse
2eggnog is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
imtellingmommy is not online. imtellingmommy
Joined: 10 Mar 2013
Total Posts: 817
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
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
24 Aug 2016 06:02 PM
:lerp()


Report Abuse
imtellingmommy is not online. imtellingmommy
Joined: 10 Mar 2013
Total Posts: 817
24 Aug 2016 06:07 PM
you COULD use that but tbh this is faster
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
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
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