Linear Spring: Difference between revisions
Updated the page
| Nikitaivanov (talk | contribs)  (Created page with "Makes the constraint springy, like a car's suspension.  /uploads/Linear Spring.png  Inputs:  * Constraint: This script must use the output of an add constraint script. This can be done directly (connect the two by a wire), or the linear spring script can be connected to a constraint variable or list. * Stiffness: A vector value. Determines the amount of force that that will be used to "spring" the objects towards their original posit...") |  (Updated the page) | ||
| Line 1: | Line 1: | ||
| {{Block | |||
| |image=Linear Spring.png | |||
| |type=s | |||
| |folder=physics | |||
| |input1={{Port|e|Before}} | |||
| |input2={{Port|c}} | |||
| |input3={{Port|v|Stiffness}} | |||
| |input4={{Port|v|Damping}} | |||
| |output1={{Port|e|After}} | |||
| }} | |||
| Makes the constraint springy, like a car's suspension. | Makes the constraint springy, like a car's suspension. | ||
| * Stiffness: A vector value. Determines the amount of force that that will be used to "spring" the objects towards their original positions. | * Stiffness: A vector value. Determines the amount of force that that will be used to "spring" the objects towards their original positions. | ||
| * Damping: A vector value. Acts as a kind of "drag" so that objects will not spring continually. | * Damping: A vector value. Acts as a kind of "drag" so that objects will not spring continually. | ||
| == Notes == | == Notes == | ||
| Before this script will function as expected, a  | Before this script will function as expected, a [[Linear Limits]] constraint must be applied to the same constraint. | ||
| The linear limits constraint is necessary because it stores the upper and lower limits between which the objects can move. | |||
| Adding a linear spring script makes the objects "spring" between these upper and lower limits. | |||
| == Examples == | == Examples == | ||
| To find the perfect "stiffness" and "damping" values for your game, try copying the ones below and then adjust them until you get the results you were looking for. | To find the perfect "stiffness" and "damping" values for your game, try copying the ones below and then adjust them until you get the results you were looking for. | ||
| {{Image|Linear spring example.png|Example}} | |||
| [[Category:Blocks]] | [[Category:Blocks]] | ||