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: "Solved spring equations"

Previous Thread :: Next Thread 
affectless is not online. affectless
Joined: 28 Dec 2014
Total Posts: 1084
12 May 2015 06:47 PM
The first bit of this video:

https://www.youtube.com/watch?v=LSoHwlC7FSg

Trying to figure out how AxisAngle did this. Anyone have an idea? I've already tried adjusting CFrame based on the speed of the camera, but this turns out rough.
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
12 May 2015 06:57 PM
Rough isn't exactly a great descriptive word of your current result. Maybe a gyazo would help.
Report Abuse
Augmentary is not online. Augmentary
Joined: 30 Aug 2013
Total Posts: 8081
12 May 2015 07:04 PM
http://gyazo.com/c6875335e008d0ffa519fa7a6812ef9f

Unfortunately, if the gif isn't going at normal speed, you can't see the effect very well. As I'm turning, the animation is choppy.
Report Abuse
affectless is not online. affectless
Joined: 28 Dec 2014
Total Posts: 1084
12 May 2015 07:07 PM
^
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
12 May 2015 07:08 PM
Are you using while wait() do? If so RunService.RenderStepped or whatever might run smoother.
Report Abuse
Augmentary is not online. Augmentary
Joined: 30 Aug 2013
Total Posts: 8081
12 May 2015 07:08 PM
I'm using RenderStepped.
Report Abuse
Augmentary is not online. Augmentary
Joined: 30 Aug 2013
Total Posts: 8081
12 May 2015 07:26 PM
hehe
Report Abuse
Augmentary is not online. Augmentary
Joined: 30 Aug 2013
Total Posts: 8081
12 May 2015 07:34 PM
i'm sad
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
12 May 2015 07:45 PM
Well that's the magic and beauty of it.

He uses the spring functions quite literally like a spring. The C1/C0 of your arm essentially has a springing tween attached to it. Meaning that when the C1/C0 of the arm is not in the desired position it will (much like a spring) return to the desired position.

--// Here's a really basic spring concept.

local val = 0
local desired = 50
local step = 1

function basicSpring()
if val ~= desired then
local diff = val > desired and val - desired or desired - val
if diff < step then
val = val > desired and val - diff or val + diff
else
val = val > desired and val - step or val + step
end
print(val, diff)
else
print("In desired position!")
end
end

game:GetService("RunService").RenderStepped:connect(basicSpring)
while wait(5) do
desired = math.random(0, 100)
end

--// End of code

So when you say you get a really jittery result you're only missing one part and that's a proper way of spring tweening your CFrames. Find that and your gold.

Sorry if you already knew all this :P
Report Abuse
Augmentary is not online. Augmentary
Joined: 30 Aug 2013
Total Posts: 8081
12 May 2015 08:01 PM
I appreciate your help, I'll try to further expand more on my script. Although if anyone else has any more suggestions, I would like to hear them also.
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