Laser data script problem
5 posts • Page 1 of 1
Laser data script problem
I'm tring to get a laser to send a unique code to another object. Thecode is unique to the laser and the object will change color if that laser is fired on it.
I'm using the fadeDist variable to encode the lasers data but the scripts are not working.
I'm using the fadeDist variable to encode the lasers data but the scripts are not working.
- Code: Select all
(e)=>{e.laser.fadedist == 1001.0 ? {e.geom.color = [1, 1, 1, 1]} }
-
Nxdt - Posts: 1019
- Joined: Mon Aug 31, 2009 6:32 pm
- Location: Scotland!
Re: Laser data script problem
The problem is you didn't write the if staement corectly.
its {a} ? {b} : {c}
its {a} ? {b} : {c}
-
Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: Laser data script problem
question ? {true} : {false};
It doesn't seem to parse right if it doesn't have a false case. You can just leave the false section empty. If you want it to do nothing if the statement is false, just do
(e)=>{e.laser.fadedist == 1001.0 ? {e.geom.color = [1, 1, 1, 1]} : {} }
It doesn't seem to parse right if it doesn't have a false case. You can just leave the false section empty. If you want it to do nothing if the statement is false, just do
(e)=>{e.laser.fadedist == 1001.0 ? {e.geom.color = [1, 1, 1, 1]} : {} }
Made some cool stuff a long time ago
-
Frank - [Best Tutorial Maker 2010]
- Posts: 193
- Joined: Mon Aug 31, 2009 6:37 pm
- Location: the dark side of the moon
Re: Laser data script problem
did it work?
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem
No really just PM me if you have a problem
-
Sniperkasa - Posts: 493
- Joined: Tue Sep 01, 2009 5:34 pm
- Location: The bottom of a lake.
5 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 15 guests