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: Manipulating Motor6Ds with scripts

Previous Thread :: Next Thread 
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 02:39 AM
how would I make the players right shoulder rotate right of the torso?
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
13 Aug 2015 02:51 AM
local Motor6D = DirectoryHere
local OriginalC0 = Motor6D.C0
for i = 0, 1, 0.1 do
Motor6D.C0 = Motor6D.C0:lerp(OriginalC0 * CFrame.Angles(math.rad(X), math.rad(Y), math.rad(z))
wait()
end
Report Abuse
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 03:06 AM
am I meant to change math.rad(X),math.rad(Y),math.rad(Z) to anything?

local Motor6D = workspace.Dummy.Torso["Right Shoulder"]
local OriginalC0 = Motor6D.C0
for i = 0, 1, 0.1 do
Motor6D.C0 = Motor6D.C0:lerp(OriginalC0 * CFrame.Angles(math.rad(X), math.rad(Y), math.rad(Z)))
wait()
end

>>> bad argument #1 to 'rad' (number expected, got nil)
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
13 Aug 2015 03:25 AM
Isn't it obvious? You're supposed to change X Y Z to a number :P
Report Abuse
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 03:51 AM
local Motor6D = workspace.Dummy.Torso["Right Shoulder"]
local OriginalC0 = Motor6D.C0
for i = 0, 10, 0.1 do
Motor6D.C0 = Motor6D.C0:lerp(OriginalC0 * CFrame.Angles(math.rad(1), math.rad(1), math.rad(i)))
wait()
end

nothing happened
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
13 Aug 2015 03:55 AM
local Motor6D = workspace.Dummy.Torso["Right Shoulder"]
local OriginalC0 = Motor6D.C0
for i = 0, 1, 0.1 do
Motor6D.C0 = Motor6D.C0:lerp(originalC0 * CFrame.Angles(0, 0, math.rad(45)), i)
wait()
end

try that? you may notice something idk lel

i can't test it as of now
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
13 Aug 2015 03:59 AM
local Motor6D = workspace.Dummy.Torso["Right Shoulder"]
local OriginalC0 = Motor6D.C0
for i = 0, 1, 0.1 do
Motor6D.C0 = OriginalC0:lerp(originalC0 * CFrame.Angles(0, 0, math.rad(45)), i)
wait()
end

my bad, try that
Report Abuse
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 04:00 AM
4 values? 0,0,math.rad(45),i?
Report Abuse
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 04:00 AM
it worked
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
13 Aug 2015 04:05 AM
look up what :lerp() takes for its arguments. it takes the desired endCFrame, and the alpha. alpha is sorta like a fraction that represents the progress of interpolation. 0 being the startPoint, 1 being the endCFrame. for example, to get a part halfway between the end cframe, just do this:

part.CFrame = part.CFrame:lerp(part.CFrame.lookVector * 6, .5)
would be 3 studs ahead of the part's original CFrame i believe

Report Abuse
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 04:33 AM
I tried

frames = {0,45,50}

local Motor6D = workspace.Dummy.Torso["Right Shoulder"]
local OriginalC0 = Motor6D.C0

for i = 1, #frames do
for x = 0, 1, .5 do
Motor6D.C0 = OriginalC0:lerp(OriginalC0 * CFrame.Angles(0, 0, math.rad(frames[i])), x)
wait()
end
end

but every next frame it starts from 0
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
13 Aug 2015 06:24 AM
I suggest u use C1 for all the animating and stuff, and in this case, it will be
CFrame.Angles(math.rad(45), 0, 0)
cos on the C1 it will be like so
X Axis = Across, as if pointing at something when it's going past u.
Y Axis = Roll, like when u think of what u want to do, underhand pull ups (chin ups) or overhand pull ups.
Z Axis = Lift the arm up, as if ur equipping a tool.

"My Life is going Good... but..."
Report Abuse
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 09:01 AM
frames = {0,45,50}

local Motor6D = workspace.Dummy.Torso["Right Shoulder"]
local OriginalC1 = Motor6D.C1

for i = 1, #frames do
for x = 0, 1, .5 do
Motor6D.C1 = OriginalC1:lerp(OriginalC1 * CFrame.Angles(0, 0, math.rad(frames[i])), x)
wait()
end
end

same, it goes to 45 then to get to 50, it starts from 0 again
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
13 Aug 2015 09:42 AM
o.O goes to 45 and starts from 0?

"My Life is going Good... but..."
Report Abuse
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 09:59 AM
so its meant to go

0, then 45, then 50

but it goes 0, 45, 0, 50
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
13 Aug 2015 10:06 AM
"for x = 0"
change that :P

"My Life is going Good... but..."
Report Abuse
Barbariancreep is not online. Barbariancreep
Joined: 23 Nov 2012
Total Posts: 1096
13 Aug 2015 10:07 AM
to?
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
13 Aug 2015 10:13 AM
anything... I noticed it's 1, .5 and if it starts at 0 then that would mean that it loops 3 times, so just
for x = 1, 3 do
:P

"My Life is going Good... but..."
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