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
 

mouse.Move vs while true do with arm animation

Previous Thread :: Next Thread 
DonFeskeral is not online. DonFeskeral
Joined: 05 Feb 2014
Total Posts: 6555
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
IAmTheRolo is not online. IAmTheRolo
Joined: 12 Nov 2013
Total Posts: 859
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
DonFeskeral is not online. DonFeskeral
Joined: 05 Feb 2014
Total Posts: 6555
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
DonFeskeral is not online. DonFeskeral
Joined: 05 Feb 2014
Total Posts: 6555
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 is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
10 Sep 2014 09:25 PM
Ew who uses CLerp
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
10 Sep 2014 09:25 PM
CLerp bad
Report Abuse
DonFeskeral is not online. DonFeskeral
Joined: 05 Feb 2014
Total Posts: 6555
10 Sep 2014 09:28 PM
well what should i use then
Report Abuse
DonFeskeral is not online. DonFeskeral
Joined: 05 Feb 2014
Total Posts: 6555
10 Sep 2014 09:31 PM
Well?

I mean what should I use?
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