AirFriction script
6 posts • Page 1 of 1
AirFriction script
Can i change AirFriction of object by pressing a button? (ctrl, space, shift etc.)
-

RafalPL - Posts: 6
- Joined: Mon Aug 22, 2011 6:55 pm
- Location: Rybnik, Poland
Re: AirFriction script
Yes, make a laser with onLaserHit script to change airFrctionMult or world air friction.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: AirFriction script
Keybinds are kind of messy and don't serialize.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: AirFriction script
use kilinich's method.
1. Open the console ( either by tidle (~) or F10).
2. Create a variable by typing 'scene.my.<variablename> = 1' and press enter.
3.Create a laser.
4.open the lazers menu and set the key you want to use
Open the script menu of the laser, and type 'scene.my.<variablename> = (set the value you want here).
5. In the object you want to change the airfriction, open the script menu, and in the airfrictionmul (or siimilar) type '{scene.my.<variablename>}'.
Ps, replace <variablename> with the name of the variable you want...
Ps, script in step 5 is really basic, and only allows one variable... I suggest you read:
[Tutorial]Thyme Tutorial - With explanations at every step
You should never use keybinds for scenes, you should use methods such as a laser with a script...
1. Open the console ( either by tidle (~) or F10).
2. Create a variable by typing 'scene.my.<variablename> = 1' and press enter.
3.Create a laser.
4.open the lazers menu and set the key you want to use
Open the script menu of the laser, and type 'scene.my.<variablename> = (set the value you want here).
5. In the object you want to change the airfriction, open the script menu, and in the airfrictionmul (or siimilar) type '{scene.my.<variablename>}'.
Ps, replace <variablename> with the name of the variable you want...
Ps, script in step 5 is really basic, and only allows one variable... I suggest you read:
[Tutorial]Thyme Tutorial - With explanations at every step
You should never use keybinds for scenes, you should use methods such as a laser with a script...
When asking for help, READ THE STICKIES!
- electronicboy
- Posts: 1694
- Joined: Mon Aug 31, 2009 6:18 pm
Re: AirFriction script
Hmm, this got me thinking...
Near-all credit to Grady on this one. He described in that Thyme tutorial in Electronicboy's link how to set up a guard system to keep Algodoo from losing local variables in objects as much.
I'm not even sure you need to call on scene.my.keyBind at the start of the scene.
Near-all credit to Grady on this one. He described in that Thyme tutorial in Electronicboy's link how to set up a guard system to keep Algodoo from losing local variables in objects as much.
- Code: Select all
scene.my.keyBind = {
keys.bind("up", {scene.my.power = scene.my.power + 1})
keys.bind("down", {scene.my.power = scene.my.power - 1})
}
I'm not even sure you need to call on scene.my.keyBind at the start of the scene.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
6 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests




