Problems with OnCollide color changing
4 posts • Page 1 of 1
Problems with OnCollide color changing
Hey, I'm new to scripting, so I did a little searching and saw that in order to make something change color when it collides with something you just type in the script menu (e)=>{color = [1.0, 0.0, 0.0, 1.0]} under onCollide, with the numbers that give your desired color. So I did this, and when I run the simulation, it does nothing. Please help :/
EDIT: For some reason, it is just now working... I tried it about 10 times before with no success... I changed nothing, and now it works... Sorry :/
EDIT: For some reason, it is just now working... I tried it about 10 times before with no success... I changed nothing, and now it works... Sorry :/
-
JDKmedeng - Posts: 37
- Joined: Mon Nov 30, 2009 2:03 am
Re: Problems with OnCollide color changing
Odd. Are you sure that you didn't spell it colour? It will make a difference. You have to use color. To change the other objects color you use e.other.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Problems with OnCollide color changing
Yeah, it's working now. But I have another problem: can I change the colors of everything in a group?
-
JDKmedeng - Posts: 37
- Joined: Mon Nov 30, 2009 2:03 am
Re: Problems with OnCollide color changing
You can.
Put
Into the color part of the script menu of each object in the group.
x = any float value between 0 and 1
- Code: Select all
scene.my.color = [1,1,1,1]
Put
- Code: Select all
{scene.my.color}
Into the color part of the script menu of each object in the group.
- Code: Select all
scene.my.color = [x,x,x,x]
x = any float value between 0 and 1
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests