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 » Scripting Helpers
Home Search
 

Re: CFrame Moving Help...

Previous Thread :: Next Thread 
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 08:39 PM
How do I Cframe a part? Moving (Loc and Rot) via script?

--Not going to be use for building. I want to try to make a walking animation..--

I'm wanting to learn how to script btw. (Roblox wiki is not helping.)
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jun 2012 09:00 PM
part.CFrame = CFrame.new(x, y, z) * CFrame.Angles(a, b, c)

Is the method I use.
First 3 numbers are position, next 3 are rotation.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
30 Jun 2012 09:00 PM
while wait() do
p = workspace.Part5
p.CFrame = p.CFrame + CFrame.new(0,.1,0)
end
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 09:06 PM
Okay lemme get this right:

The "part.CFrame = CFrame.new(x, y, z)" is where the "part" will move on the X,Y,Z axis.

And the "CFrame.Angles(a, b, c)" will rotate the "part" on the X,Y,Z axis right?

Also, IF I remember this right.... If I put a 90 in A,B or C it will not rotate degrees right???
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jun 2012 09:10 PM
1) Yes
2) Yes
3) Yes, it's in radians; not degrees. math.rad(Degrees) can be used to convert, but I'd recommend remembering the formula that

Rad = Degrees / 180 * pi
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 09:23 PM
How many Rads are in one degree?

(Rads to me= Radiation....Played to much fallout...)
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jun 2012 09:37 PM
Using our formula:

Rad = Degree / 180 * pi
Rad = 1 / 180 * pi
Rad = pi/180
Rad ≈ .017453293
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 09:54 PM
??? Huh? :/

Okay where would I put " math.rad(Degrees) " in " LegR.CFrame = CFrame.new(x, y, z) * CFrame.Angles(a, b, c) "???


Or in other words, how would I use " math.rad(Degrees) "?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jun 2012 09:54 PM
Like, instead of a
math.rad(a)
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 10:00 PM
So like this?

LegR.CFrame = CFrame.new(x, y, z) * math.rad(a)
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jun 2012 10:01 PM
CFrame.new(math.rad(a), math.rad(b), math.rad(c))
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 10:07 PM
CFrame.new(math.rad(a), math.rad(b), math.rad(c))

A means X
B means Y
C means Z

Right?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jun 2012 10:14 PM
Yes.

(Note it means AROUND that axis)
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 10:16 PM
Around= the center of the object?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jun 2012 10:17 PM
Yes.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 10:32 PM
Okay well Ima go making something happen...

Also, if I hit the green button (Play?) will I be able to see the object move?

And one more thing, I have to legs LegR and LegL both are in a group, I would put the script to Cframe those legs into the group that the legs are in right?
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 10:33 PM
Oh and this is a Humanoid I'm testing this one (Not the play but a dumb NPC)
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 10:44 PM
Sorry its Left Leg and Right Leg.

And if I want to Cframe a part it would look like this right?

While true do -- For a loop
Left Leg.CFrame = CFrame.new(x, y, z) * CFrame.new(math.rad(45), math.rad(0), math.rad(0))
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Jun 2012 11:02 PM
Please go to this thread instead.

http://www.roblox.com/Forum/ShowPost.aspx?PostID=71206634
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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