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: How do I do CFrame Animation?

Previous Thread :: Next Thread 
LavanderLights is not online. LavanderLights
Joined: 21 Oct 2013
Total Posts: 3526
21 Apr 2015 08:36 AM
[ Not asking for a script, just wanted to know how. ]
Hi, I was looking to make an animation for a tool. But the problem is, I don't know how to do CFrame animation. Could someone explain to me how it work?
Report Abuse
kenshin07 is not online. kenshin07
Joined: 18 Feb 2010
Total Posts: 895
21 Apr 2015 08:37 AM
roblox's animation plugin,
http://www.roblox.com/Animation-Editor-item?id=144373835
after making the animation
export it
as you export it
use the exported asset's ID for the animation script thing that your tool is gonna use
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
21 Apr 2015 08:38 AM
He said "CFrame" animation
Report Abuse
LavanderLights is not online. LavanderLights
Joined: 21 Oct 2013
Total Posts: 3526
21 Apr 2015 08:39 AM
@kenshin
Was looking for CFrame animation.
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
21 Apr 2015 08:43 AM
Normally when you CFrame an animation, You need to try to interpolate. So it looks smooth from point A to B It's really a matter of just moving the "Weld.C1" because you will detach the arms and weld them to the body instead
Report Abuse
LavanderLights is not online. LavanderLights
Joined: 21 Oct 2013
Total Posts: 3526
21 Apr 2015 08:45 AM
let me guess
for loop?
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
21 Apr 2015 08:47 AM
You'd want to RenderStep then, but a while loop works as long as it's broken once it's done.
Report Abuse
LavanderLights is not online. LavanderLights
Joined: 21 Oct 2013
Total Posts: 3526
21 Apr 2015 09:22 AM
Here's my failed attempt at it.
animCounter1 = 0
animCounter2 = 0
animCounter3 = 0
animSequence1 = 8
animSequence2 = 8
animSequence3 = 45
desiredNumber = animCounter1 + animCounter2 + animCounter3
game:GetService("RunService").RenderStepped:connect(function()
if animCounter1 < animSequence1 then
animCounter1 = animCounter1 + 1
game.Players.LocalPlayer.Character.Torso["Left Hip"].C1 =game.Players.LocalPlayer.Character.Torso["Left Hip"].C1 * CFrame.Angles(0,0,-0.1)
elseif animCounter2 < animSequence2 then

animCounter2 = animCounter2 + 1
game.Players.LocalPlayer.Character.Torso["Left Hip"].C1 =game.Players.LocalPlayer.Character.Torso["Left Hip"].C1 * CFrame.Angles(0,0,0.1)
elseif animCounter3 < animSequence3 then

animCounter3 = animCounter3 + 1
game.Players.LocalPlayer.Character.Torso["Left Hip"].C1 =game.Players.LocalPlayer.Character.Torso["Left Hip"].C1 * CFrame.Angles(0,0,0.1)
elseif animCounter1 + animCounter2 + animCounter3 == desiredNumber then return end
end)
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
21 Apr 2015 09:34 AM
Oh my... that wasn't exactly what I was hinting

for loop to make interpolation, and renderstep that for loop

RenderStep:wait()
Report Abuse
LavanderLights is not online. LavanderLights
Joined: 21 Oct 2013
Total Posts: 3526
21 Apr 2015 09:35 AM
oh lol
i thought you were telling me to use RenderStepped for loop
sorry
Report Abuse
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
21 Apr 2015 10:16 AM
I made a plugin for CFrame animations, I made it for myself cause I make a lot of animations and I'm too poor to pay 30 robux, you can install it, but I ain't explaining how it works. It might be hard to understand, lol.
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
21 Apr 2015 10:39 AM
you could try

lerp()
Report Abuse
LavanderLights is not online. LavanderLights
Joined: 21 Oct 2013
Total Posts: 3526
21 Apr 2015 12:56 PM
@Yobo
i'm starting to like that thing
not sure how am i gonna make it work for rotation though
but i'll mess with it anyway
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
21 Apr 2015 12:57 PM
lerping/interpolation would do rotation...

I know TurboFusion in his gun script had something that Tween's Joints and it works really well for Rotations.
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
21 Apr 2015 01:00 PM
"I'm too poor to pay 30 robux"

animations are free

I appreciate your attempt at humor
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
21 Apr 2015 01:01 PM
^

They "were" 30 robux
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
21 Apr 2015 01:02 PM
They haven't been for months though

I appreciate your attempt at humor
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
21 Apr 2015 01:03 PM
Is it sad I realized they weren't when someone told me couple days ago?
Report Abuse
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
21 Apr 2015 02:15 PM
wow, i never knew they became free???
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
21 Apr 2015 02:49 PM
Here, this is linear interpolation, I made this in like 2 minutes so its not cleaned up.

local function interpolate(PART,CF00,CF02,INC)
local s = {CF00:components()}
local e = {CF02:components()}

local function lerp(Start,End,Ratio)
return Start + (End - Start)*Ratio
end

local function lerpCF(Ratio)
local new = {}
for i = 1,#s do
rawset(new,i,lerp(rawget(s,i),rawget(e,i),Ratio))
end
return CFrame.new(unpack(new))
end

for i = 0,1,INC do
PART.CFrame = lerpCF(i)
wait()
end

end
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
21 Apr 2015 02:51 PM
that's not how you interpolate rotation matrices.
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
21 Apr 2015 02:51 PM
http://www.roblox.com/CFrameInterpolator-Module-item?id=161739700

I recommend stravant's module

To use it for interpolation, it'll work like this

local module = require()
local _, Interpolate = module(startCFrame, endCFrame)

for i = 0, 1, .1 do
weld.C1 = Interpolate(i)
wait()
end

The module returns a function, which will return a theta and another function. I don't believe that you'll need a theta so I just made it an unused variable. The function will return a CFrame that works like :Lerp()

For example, if I used "Interpolate(.5)" it'll return a CFrame halfway between the two given CFrames
Report Abuse
CrescentJade is not online. CrescentJade
Joined: 07 Jul 2010
Total Posts: 5494
21 Apr 2015 02:52 PM
How do you then? I just thought of a basic one, I havent looked into liner algebra so I used my common knowledge of lerping.
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
21 Apr 2015 03:02 PM
@Crescent

I wish I could explain it to you, but all I know is the problems you will face if you try that. People commonly look to quaternions and slerp when doing that (you can search up "Slerp" for more detail). Here is a thread from 2012 about someone who tried a similar thing that you did. The posters explain it in more detail than I could.

http://www.roblox.com/Forum/ShowPost.aspx?PostID=82149372
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