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: CFrame Animations

Previous Thread :: Next Thread 
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 05:56 PM
I finally want to learn how to animate using CFrame like litozinnamon, but I cannot figure it out. I know about Torso.Neck, Torso.Shoulders. etc. but I don't know what C0 and C1 is. I mean I tried printing C0 and C1, C0 and C1 prints out 8 numbers. I thought it was just 3? Please help me what is C0 and C1.
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
18 Jul 2015 05:59 PM
The first 3 are the coordinates, the other 9 are its rotational matrix.

I'm pretty sure it didn't print 8 numbers


I don't need a siggy
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:01 PM
Oops, 9 then. How do I use the rotational matrix? I studied it but I don't get it.
Report Abuse
Ryzox is not online. Ryzox
Joined: 26 Dec 2012
Total Posts: 109
18 Jul 2015 06:01 PM
http://wiki.roblox.com/index.php?title=CFrame
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:04 PM
Oh. So the rotation matrix relates to the toolgrips?
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
18 Jul 2015 06:06 PM
Sort of, but I think we are getting off topic here.

"C0 determines how the [offset point] should be attached to the Part0
C1 determines how the Part1 should be attached to the [offset point]"

^ From wiki


I don't need a siggy
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:07 PM
But the neck has C0 and C1. If C0 (Part0) or C1 (Part1) is the head, what is the other one?
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:08 PM
Or is it the torso and the head?
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
18 Jul 2015 06:10 PM
Part0 should be the parent of the weld and Part1 should be what it is welding to

Part0 is probably the torso
Part1 is probably the head

I think the torso has all the welds, correct me if I'm wrong.


I don't need a siggy
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:12 PM
Yes, the torso does have all the welds.

So what if I do this,
Neck.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Would it work? Or I need to do
Neck.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(1, 0, 0, 0, 1, 0, 0, 0, 1)
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:14 PM
On wiki, it says that you can use this:
CFrame.new(x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22)
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:18 PM
b?
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
18 Jul 2015 06:19 PM
Just don't try to use the matrix.

Just do CFrame.new(x,y,z) * CFrame.Angles(math.rad(a),math.rad(a),math.rad(a))


I don't need a siggy
Report Abuse
Tuneable is not online. Tuneable
Joined: 16 Feb 2013
Total Posts: 2932
18 Jul 2015 06:22 PM
just use CFrame.lerp
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
18 Jul 2015 06:23 PM
^ You are a genius my friend


I don't need a siggy
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:26 PM
Why would I use lerp? It's for sprinting, slashing, etc.

I found the original head CFrame, correct me if I'm wrong:
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180))

I tried it and it seems to work fine, the head is at it's original position and rotation.
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
18 Jul 2015 06:27 PM
https://pbs.twimg.com/tweet_video/CJmuf40VEAA8j7w.mp4


I don't need a siggy
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:31 PM
Lol i saw that, but I wanna frame it at my own speed.
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:37 PM
My first attempt:
Of course, I can use for and do's, but who cares ;)

local action = "yes"

if action == "yes" then
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-92),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-94),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-96),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-98),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-98),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-96),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-94),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-92),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180))
wait(0.01)
elseif action == "no" then
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(182))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(184))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(186))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(188))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(190))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(188))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(186))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(184))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(182))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(178))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(176))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(174))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(172))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(170))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(172))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(174))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(176))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(178))
wait(0.01)
script.Parent.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180))
wait(0.01)
end
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
18 Jul 2015 06:38 PM
You can.

Roblox added an alpha parameter to cframe lerp. Which is used to set the point of the lerping.

.5 would be half way through
1 would be the complete run
0 would be the initial run

local start = obj.CFrame
local end = CFrame.new(whatefver)

for i = 0,1,0.01 do
obj.CFrame = start.CFrame:lerp(end,i)
wait()
end


I don't need a siggy
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
18 Jul 2015 06:39 PM
Oh my god, you gave me cancer


I don't need a siggy
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
18 Jul 2015 06:40 PM
Meh. I want to study this. I know how to use lerp. But I got a question,
How do I CFrame even when the part is anchored? It doesn't seem to work
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