Browse Search Popular Register Upload Rules User list Login:
Search:
Why Isn't This Working?

Image:
screenshot of the scene

Author: FruitMonger

Group: Default

Filesize: 24.76 kB

Date added: 2014-02-13

Rating: 5

Downloads: 453

Views: 217

Comments: 4

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

I really do not understand why this scene isn't working.

The plan was to have the yellow spring change its length when "a" was held down, and the mouse was moved left and right (or up and down, doesn't matter really).
Instead, my _len variable keeps going question mark on me, and the length doesn't change one bit.

Variables used are as follows:

_mp - Mouse pos
_len - Length
_v1 - Variable 1

Other custom variables marked as NaN were abandoned because I thought the problem was that they didn't have a "_" symbol in front of them.


Anybody have any ideas? Any help would be greatly appreciated. I feel like it'll be a stupidly simple thing that I overlooked once, and so marked as a non-issue.
Please log in to rate this scene
edit
Similar scenes
Title: Working Computer V0.1Beta
Rating: 5
Filesize: 426.91 kB
Downloads: 937
Comments: 0
Ratings: 1
Date added: 2011/09/20 22:52:23
Made with: Algodoo v1.9.9b
Rating: rated 5
download
Title: Hydraulic cylinders (working) and working on texture
Rating: 5
Filesize: 40.99 kB
Downloads: 674
Comments: 2
Ratings: 1
Date added: 2009/07/07 11:58:51
Made with: Phun
Rating: rated 5
download
Title: working functional elev
Rating: 5
Filesize: 0.5 MB
Downloads: 245
Comments: 3
Ratings: 1
Date added: 2018/02/20 20:24:00
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Zippo with working sparker and working case.
Rating: 6.6364
Filesize: 91.38 kB
Downloads: 2214
Comments: 3
Ratings: 5
Date added: 2009/09/17 00:45:19
Made with: Phun
Rating: rated 6.6
download
Title: Experemental Gun Test
Rating: 5
Filesize: 16.53 kB
Downloads: 67
Comments: 0
Ratings: 1
Date added: 2016/11/27 05:46:56
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: help!
Rating: 5
Filesize: 18.37 kB
Downloads: 295
Comments: 0
Ratings: 1
Date added: 2008/08/11 23:34:52
Made with: Phun
Rating: rated 5
download
Move the script from onKey to postStep, then it will work!
Good call, Xray. It looks like _mp constantly updates when in onKey but not when in postStep. Also, the code only needs to be in one object (the spring), not three. Use the Alt key to select just one object.
That's a good point about selecting springs. Some people may not realize that when you select a spring in the usual way that you select other objects, you will actually select three objects (the spring and the two end points). If you want to select only the spring, you must press and hold the Alt key while clicking on the spring.

In this particular case, Fruitmonger selected all three objects because I see that the script was written to all three objects (which is redundant and ill-advised). Therefore, he should delete the code that was written to both end points, and then move the code in the spring.
Thanks guys, I'll give all that a try. I can't believe I forgot to hit alt when selecting the spring. :bonk: