Friction Console Script (question)
			7 posts			 • Page 1 of 1		
	
Friction Console Script (question)
How would I script a box to change the friction of a circle using console and oncollide?
My idea: When the box gets hit with an object, it changes the friction of a circle from 0 to 2.00
 
  
			
		My idea: When the box gets hit with an object, it changes the friction of a circle from 0 to 2.00
- 
				

jrderksen - Posts: 68
 - Joined: Wed Dec 22, 2010 4:50 am
 - Location: British Columbia, Canada
 
Re: Friction Console Script (question)
What have you tried doing anyway? You won't always get your answers just by asking, you have to figure them out yourself too.
Anyway, use a scene variable(scene.my.blah) that changes whenever that box gets hit. Input that scene variable into the friction of the circle. There you go. That's the pseudo-code. Either you wait for someone to make the actual code for you, or you try to discover it. You're choice.
			Anyway, use a scene variable(scene.my.blah) that changes whenever that box gets hit. Input that scene variable into the friction of the circle. There you go. That's the pseudo-code. Either you wait for someone to make the actual code for you, or you try to discover it. You're choice.
Millions of voices suddenly cried out in terror, and were suddenly silenced. Something terrible has happened.
		- 
				

RicH - [Funniest Person 2010]
 - Posts: 2043
 - Joined: Tue Sep 01, 2009 9:01 am
 
Re: Friction Console Script (question)
^Ok, thanks. That helps. I actually did try to figure it out, I just thought I might try asking, so I could get a better idea.
			
		- 
				

jrderksen - Posts: 68
 - Joined: Wed Dec 22, 2010 4:50 am
 - Location: British Columbia, Canada
 
Re: Friction Console Script (question)
You're learning. Very good.  
			Millions of voices suddenly cried out in terror, and were suddenly silenced. Something terrible has happened.
		- 
				

RicH - [Funniest Person 2010]
 - Posts: 2043
 - Joined: Tue Sep 01, 2009 9:01 am
 
Re: Friction Console Script (question)
What I would do however, is this:
I would set it up so the circle in question actually gets hit. I would also set the controllerAcc of the thing that changes the friction to 36.4.
In the onCollide of the circle goes this code:
			I would set it up so the circle in question actually gets hit. I would also set the controllerAcc of the thing that changes the friction to 36.4.
In the onCollide of the circle goes this code:
- Code: Select all
 {e.other.friction == 36.8} ? {friction = 200} : {}
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: Friction Console Script (question)
^Interesting. I ended up just using hinges which brake when you hit a key (This is for a spring-engine cars' gearing).
			
		- 
				

jrderksen - Posts: 68
 - Joined: Wed Dec 22, 2010 4:50 am
 - Location: British Columbia, Canada
 
Re: Friction Console Script (question)
Ooops... I just realized I made a mistake in my code. 
 
It should be
			It should be
- Code: Select all
 {e.other.controllerAcc == 36.8} ? {friction = 200} : {}
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
 
			7 posts			 • Page 1 of 1		
	Who is online
Users browsing this forum: No registered users and 7 guests



