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: 739

Views: 494

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: GUN!!!!!
Rating: 5
Filesize: 28.55 kB
Downloads: 399
Comments: 0
Ratings: 1
Date added: 2015/10/28 19:05:50
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: working fan heater power outlet
Rating: 4.5
Filesize: 0.55 MB
Downloads: 1113
Comments: 15
Ratings: 2
Date added: 2023/07/11 16:55:32
Made with: Algodoo v2.1.0
Rating: rated 4.5
download
Title: Hydraulic cylinders (working) and working on texture
Rating: 5
Filesize: 40.99 kB
Downloads: 905
Comments: 2
Ratings: 1
Date added: 2009/07/07 11:58:51
Made with: Phun
Rating: rated 5
download
Title: Red car 2.0 with working chaingun
Rating: 5
Filesize: 81.1 kB
Downloads: 443
Comments: 2
Ratings: 1
Date added: 2009/12/30 01:48:01
Made with: Phun
Rating: rated 5
download
Title: An *almost* Fully Working (Semi-Auto) Gun Inside Algodoo[Improved]
Rating: 5
Filesize: 27.48 kB
Downloads: 578
Comments: 0
Ratings: 1
Date added: 2023/08/10 07:50:06
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Working Blackhawk Helicopter
Rating: 5.25
Filesize: 94.03 kB
Downloads: 4472
Comments: 4
Ratings: 6
Date added: 2009/03/20 19:42:38
Made with: Phun
Rating: rated 5.3
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: