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: Problems with CFrame script.

Previous Thread :: Next Thread 
mylowoof is not online. mylowoof
Joined: 27 Mar 2014
Total Posts: 167
21 Jun 2015 06:19 AM
I am attempting to do CFrame animation. I have a script which disconnects the Motor6D's in the character and replaces them with welds. So far so good. It removes all animations. However, i cant figure out how to set the actual cframe so the limbs are rotated in the correct direction. This is the first script i tried out. Its meant to put the characters right arm in the default tool position.:

torso["Left Arm"].C0 = CFrame.new(1.50000024, 0.501270056, -0.499999523, 1, 1.30917414e-007, -1.31458393e-007, -1.31134016e-007, -0.00247461861, -0.999996781, -1.31242331e-007, 0.999996901, -0.00247461954)

I took those coordinates via script from a dummy which i was using to test my animations.

The rotation turned out exactly as it should, but the position was slightly above the torso.

Changing 'C0' to 'C1' put it in the right position, but rotated 180 degrees so it faced backwards on the character.

So i decided to try using CFrame.Angles, because i don't understand how the rotational matrix works.

After about 2 hours or so (literally), the best i could come up with was this:

torso["Left Arm"].C1=CFrame.new(torso["Left Arm"].C1.p,CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)))

Which brings up the following error

bad argument #2 to 'new' (Vector3 expected, got userdata)

How do i write the CFrame coordinates out so that they show up no errors and are fairly easily customisable? (bearing in mind that i don't know how the CFrame rotational matrix works) Is there an easier method that experienced developers use?

Thanks in advance.
Report Abuse
BlueWizard12345 is not online. BlueWizard12345
Joined: 31 Mar 2012
Total Posts: 906
21 Jun 2015 06:23 AM
Make an animation with the animation plugin, set the priority to action, and export when you are done. http://wiki.roblox.com/index.php?title=Animations
Report Abuse
mylowoof is not online. mylowoof
Joined: 27 Mar 2014
Total Posts: 167
21 Jun 2015 06:27 AM
I am coding my own animation system because it is necessary in my game for the animations to be stopped at any time. The animations need to slide smoothly back to the default position, something that isn't possible with the Roblox animation system.
Report Abuse
mylowoof is not online. mylowoof
Joined: 27 Mar 2014
Total Posts: 167
21 Jun 2015 06:59 AM
Not sure i was completely clear on what i want in the original post. Basically, what's the best way of adjusting either C0 or C1 so that the angles are easily editable?
Report Abuse
mylowoof is not online. mylowoof
Joined: 27 Mar 2014
Total Posts: 167
21 Jun 2015 08:37 AM
Bump
Report Abuse
mylowoof is not online. mylowoof
Joined: 27 Mar 2014
Total Posts: 167
22 Jun 2015 02:32 AM
Bump
Report Abuse
mylowoof is not online. mylowoof
Joined: 27 Mar 2014
Total Posts: 167
22 Jun 2015 04:50 AM
Realized that you dont need all the extra info about my animation system o_o

All i want is a command to enter into the command bar to change the C0 or C1 of a weld. It needs to be able to edit the rotation of Part1 relative to Part0 without changing the position.
Report Abuse
omegashawn123 is not online. omegashawn123
Joined: 27 Sep 2013
Total Posts: 269
22 Jun 2015 05:01 AM
This Video may help you

https://www.youtube.com/watch?v=WN1ziF3eCMY&list=PLA4609EA2E5307C94&index=9
Report Abuse
omegashawn123 is not online. omegashawn123
Joined: 27 Sep 2013
Total Posts: 269
22 Jun 2015 05:02 AM
it Does not use animation plugin
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
22 Jun 2015 05:13 AM
Use math.rad() and record rotations like that.
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