color change help
			5 posts			 • Page 1 of 1		
	
color change help
I am getting better at thyme but some of my scripts dont work. I have a box being hit by a laser and i want the box to change to the color of the laser when hit by it. So this is the code on the block: e.this.color := e.other.color  But it doesn't work so please help. Also what does the maxrays thing do and is there a way to split lasers?
			I won't be on the forums much for a while. But maybe once in a while.
		- 
				

HavingPhun - Posts: 178
 - Joined: Sun Feb 06, 2011 10:42 pm
 
Re: color change help
e.geom.color, not e.other.color when working with lasers. Other is for collisions, geom is for lasers.
Maxrays is the number of rays a laser can have. A laser with a thousand maxrays can be split 1000 times. So if you set the maxrays to one, you can put the laser inside a transparent object, and the laser will only hit the object once, and will only hit that object. Play around with maxrays, you will get interesting results.
			
		Maxrays is the number of rays a laser can have. A laser with a thousand maxrays can be split 1000 times. So if you set the maxrays to one, you can put the laser inside a transparent object, and the laser will only hit the object once, and will only hit that object. Play around with maxrays, you will get interesting results.
- 
				

TC42 - Posts: 984
 - Joined: Sun Jan 09, 2011 1:53 pm
 - Location: $ sudo apt get-install sandwich_
 
Re: color change help
thanks and how do you split lasers?
Edit: even if I change it to e.this.color := e.geom.color it still does not work!!!
			Edit: even if I change it to e.this.color := e.geom.color it still does not work!!!
I won't be on the forums much for a while. But maybe once in a while.
		- 
				

HavingPhun - Posts: 178
 - Joined: Sun Feb 06, 2011 10:42 pm
 
Re: color change help
It should be = not := , and you can split lasers using transparent and partially transparent objects.
Ohhh, so you want the code in the box, not the laser, right?
So the code for the box would be
So it's
e.laser: laser hitting object
e.geom: the object hit
e.other: used for collisions
			
		Ohhh, so you want the code in the box, not the laser, right?
So the code for the box would be
- Code: Select all
 onhitbylaser= (e)=>{color=e.laser.color}
So it's
e.laser: laser hitting object
e.geom: the object hit
e.other: used for collisions
- 
				

TC42 - Posts: 984
 - Joined: Sun Jan 09, 2011 1:53 pm
 - Location: $ sudo apt get-install sandwich_
 
Re: color change help
works now thanks TC42
			I won't be on the forums much for a while. But maybe once in a while.
		- 
				

HavingPhun - Posts: 178
 - Joined: Sun Feb 06, 2011 10:42 pm
 
			5 posts			 • Page 1 of 1		
	Who is online
Users browsing this forum: No registered users and 7 guests




