Switch a laser by collide
7 posts • Page 1 of 1
Switch a laser by collide
Hello,
I wanted to know if we can, by scripting with on collide, switch a laser. For example; you create a box, and when an other object collide this box, a laser can be switched on.
Thank you for answering, and I hope that despite my bad english you'll understand my question!
I wanted to know if we can, by scripting with on collide, switch a laser. For example; you create a box, and when an other object collide this box, a laser can be switched on.
Thank you for answering, and I hope that despite my bad english you'll understand my question!
- Thooto
- Posts: 45
- Joined: Sat Mar 26, 2011 2:02 pm
Re: Switch a laser by collide
Hmm... Try changing the color of the box.
If color == [0, 0, 0, 0], the laser will pass right through it.
If color == [1, 1, 1, 1], the laser will be blocked.
Make sure you attach the laser TO the box. And the box's refractiveIndex = 1.
If color == [0, 0, 0, 0], the laser will pass right through it.
If color == [1, 1, 1, 1], the laser will be blocked.
Make sure you attach the laser TO the box. And the box's refractiveIndex = 1.
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: Switch a laser by collide
don't listen him 
1) create scene.my. variable (open console with ~ key and type scene.my.laser := 0)
2) set laser maxRays property to {scene.my.laser}
3) set onCollide script of one of the boxes to (e) = {scene.my.laser = 1}
1) create scene.my. variable (open console with ~ key and type scene.my.laser := 0)
2) set laser maxRays property to {scene.my.laser}
3) set onCollide script of one of the boxes to (e) = {scene.my.laser = 1}
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: Switch a laser by collide
don't listen him![]()
I try to not use scene.my wherever possible.
Thus, I think that blocking the laser is the way to go. It's phunlet-safe and can be used multiple times within a 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
Re: Switch a laser by collide
Ok thank you for your answers! 
I'll try to use the two ideas you told me!
By the way, thank you two, you gave me many ideas!
I'll try to use the two ideas you told me!
By the way, thank you two, you gave me many ideas!
- Thooto
- Posts: 45
- Joined: Sat Mar 26, 2011 2:02 pm
Re: Switch a laser by collide
Someone Else wrote:don't listen him![]()
I try to not use scene.my wherever possible.
Thus, I think that blocking the laser is the way to go. It's phunlet-safe and can be used multiple times within a scene.
oh, sorry, now I've got your point.
btw not only [0, 0, 0, 0] color is transparent, actually any color with zero alpha will fit.
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: Switch a laser by collide
I know. [0, 0, 0, 0] and [1, 1, 1, 1] are easy to remember.
And glad I could help.
And glad I could help.
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



