|
| 10 Sep 2014 09:19 PM |
My arm movement code is here
function track() weld = welds[1];
_G.Offset = CFrame.new(0,0,0); offset = _G.Offset;
local lookAt = torso.CFrame:toObjectSpace(CFrame.new(torso.CFrame.p, mouse.Hit.p));
lookAt = lookAt * CFrame.new(1,0.3,0) * CFrame.Angles(1.585,0,0) * offset;
RightArm = lookAt;
LeftArm = CFrame.new(0.7,-0.5,1.2) * CFrame.Angles(0,-0.4,0) * lookAt;
weld.C0 = CLerp(weld.C0,RightArm,1); welds[2].C0 = CLerp(welds[2].C0,LeftArm,1); print(math.random(1,1000)); end; mouse.Move:connect(track)
However, I want to make the player do a breathing motion constantly right
so if my mouse isnt moving and offset is a constantly changing value that is multiplied and detracted from to get a set value that represents if a player should be reloading or breathing and both
However, theoretically, your arm would animate if your mouse was moving
using a while true do would help that, but wouldnt it be a lot worse?
How can I do this?
I know this is some pretty high level stuff |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2014 09:21 PM |
| I like connecting my animations to a .RenderStepped if the game is in third person, and a camera.Changed if it's a first person game. |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2014 09:21 PM |
CLerp code (given to me by accomplishable full credit to him for it)
function Return(Alpha, Bravo, Charlie) return Alpha + (Bravo - Alpha) * Charlie; end function CLerp(C1, C2, Speed) local Comp1 = {C1.X, C1.Y, C1.Z, C1:toEulerAnglesXYZ()}; local Comp2 = {C2.X, C2.Y, C2.Z, C2:toEulerAnglesXYZ()}; for num, accel in pairs(Comp1) do Comp1[num] = Return(accel, Comp2[num], Speed); end return CFrame.new(Comp1[1], Comp1[2], Comp1[3]) * CFrame.Angles(select(4,unpack(Comp1))); end
if it helps. |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2014 09:24 PM |
Generally this is going to be both.
this works fine now for what its intended but it will either override and mess up seperately running animations theoretically
otherwise the animations will only run if the mouse is being changed. |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|
| |
|
|
| 10 Sep 2014 09:28 PM |
| well what should i use then |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2014 09:31 PM |
Well?
I mean what should I use? |
|
|
| Report Abuse |
|
|