Lem0nzzz
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 521 |
|
|
| 10 Jul 2015 04:10 AM |
| How do you animate a player with CFrame, like how do you know what you're doing and if your moving it correctly? |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2015 04:14 AM |
you would need to use stuff like CFrame operators, for and repeat loops, all that stuff that rotates parts and moves them
<3 cats <3 |
|
|
| Report Abuse |
|
|
qdhxx
|
  |
| Joined: 02 Jul 2010 |
| Total Posts: 56658 |
|
|
| 10 Jul 2015 04:16 AM |
You'd have to go in studio and move a dummy's limbs then check it's cframes and copy them into your script.
>mfw blessed http://www.roblox.com/face-item?id=241134674 |
|
|
| Report Abuse |
|
|
ganger800
|
  |
| Joined: 06 Dec 2012 |
| Total Posts: 427 |
|
|
| 10 Jul 2015 04:18 AM |
http://wiki.roblox.com/index.php?title=User:MrNicNac/CFrame_Cheat_Sheet
I use that wiki page much :) it is a little bit hard at first, however it is worth reading |
|
|
| Report Abuse |
|
|
duckwit
|
  |
| Joined: 08 Aug 2008 |
| Total Posts: 1310 |
|
|
| 10 Jul 2015 04:18 AM |
A CFrame data structure in ROBLOX is actually a combination of two mathematical entities: A 3-dimensional vector and a 3x3 rotation matrix.
The vector denotes the position of the centre of a part, and the matrix determines the orientation. To manipulate Parts by adjusting their CFrame intuitively essentially requires that you understand 3D transformations with vectors and matrices, and particularly the behaviour of matrix multiplication.
It would be difficult to write an introduction to matrices here, but it's something that you can probably ask a mathematics teacher about at your school. |
|
|
| Report Abuse |
|
|
Lem0nzzz
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 521 |
|
|
| 10 Jul 2015 04:22 AM |
Well I figured out how to do
game:GetService("RunService")
rarm.C0 = rarm.C0 * CFrame.Angles(0,0,1)
But, the difficulty is keeping it smooth. Is there a way to make the cframing go through really smooth? |
|
|
| Report Abuse |
|
|
Chrapnel
|
  |
| Joined: 01 Feb 2014 |
| Total Posts: 951 |
|
| |
|
duckwit
|
  |
| Joined: 08 Aug 2008 |
| Total Posts: 1310 |
|
|
| 10 Jul 2015 04:33 AM |
You can update the configuration of welds approximately every 1/60th of a second by connecting to the RunService.RenderStepped event (LocalScript only).
Instead of rotating by a fixed increment at every step, you should adjust the CFrame by a varying degree depending on how much time has passed since the last change.
e.g. local rotateSpeed = math.rad(10) --10 degrees per second local t = tick()
game:GetService'RunService'.RenderStepped:connect(function() local changeInTime = tick() - t rarm.C0 = rarm.C0 * CFrame.Angles(0,0, rotateSpeed * changeInTime) t = tick() end) |
|
|
| Report Abuse |
|
|
Chrapnel
|
  |
| Joined: 01 Feb 2014 |
| Total Posts: 951 |
|
|
| 10 Jul 2015 04:34 AM |
| http://www.roblox.com/CFrameInterpolator-Module-item?id=161739700 |
|
|
| Report Abuse |
|
|
Lem0nzzz
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 521 |
|
|
| 10 Jul 2015 04:44 AM |
When I move a dummies arm, and try doing it inside of a script like this, this would be the dummies coordinates for the "rotation" property; -0,-0,15
I try this rarm.C0 = rarm.C0 * CFrame.fromEulerAnglesXYZ(-0, -0, 15), but it rotates a completely different angle. |
|
|
| Report Abuse |
|
|
duckwit
|
  |
| Joined: 08 Aug 2008 |
| Total Posts: 1310 |
|
|
| 10 Jul 2015 04:51 AM |
In this case the rotation is described in radians, not degrees.
You can convert degrees to radians with math.rad and you can change back to degrees with math.deg.
When you use math.rad(x), the calculation being performed is actually math.pi * x/180. Similarly, when you use math.deg(x), the calculation is 180 * x/math.pi.
e.g.
valueInRadians = math.rad(valueInDegrees) valueInDegrees = math.deg(valueInRadians) |
|
|
| Report Abuse |
|
|
| |
|
Lem0nzzz
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 521 |
|
|
| 10 Jul 2015 04:55 AM |
Well I heard a radian would be
CFrame.fromAxisAngle(), problem with that it keeps printing this in the output; 02:52:41.106 - Players.Player1.Backpack.LocalScript:8: bad argument #2 to '?' (Vector3 expected, got function)
This is the incorrect line rarm.C0 = rarm.C0 * CFrame.fromAxisAngle(-0,-0,15)
Don't get me wrong I have never even used fromAxisAngle, So It's hard for me to understand it since it's not even in the wiki. But I looked at what it does, and it says it uses radians. |
|
|
| Report Abuse |
|
|
Lem0nzzz
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 521 |
|
|
| 10 Jul 2015 05:02 AM |
| @Above is there a motor6D Tutorial? |
|
|
| Report Abuse |
|
|
Lem0nzzz
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 521 |
|
|
| 10 Jul 2015 05:14 AM |
| C0 basically moves the players arm with the player while it's moving. The problem with that is with the game I'm making I can't have it. What do I do so the arm won't move with the player while the animation is activated? |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 10 Jul 2015 06:17 AM |
Axis angles take an axis (Vector3) and an angle (radians).
cf * CFrame.fromAxisAngle(Vector3.new(0,1,0), math.rad(90)) |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2015 08:24 AM |
well, from my experience it's not as hard as ya think, it's actually pretty easy! once I thought "how the hell am I gonna get past this task: Reload Animation for gun" and once I started, I got it so fast! :D I just use the info I know... I Animate with C1 so, X = Arm goes left to right (as if ur pointing at a car when it goes from 1 point to another and ur standing at the side watching) Y = Arm rolling (as if I was holding a gun and wanted to act cool and twisted my arm so the gun would be like sideways, so I'd look like a gan-gsta) Z = Lift the arm up (just like I equip a tool and my arm goes up) so I used this knowledge and just imagined it in my head, and done it :D and no dummies needed, though however, I might start using dummies for better animations if I can't do it without a dummy :/ but trust me, it is possible without a dummy...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|