Page 1 of 1

How do i change collision layers with the OnLazerHit script

PostPosted: Wed Jun 04, 2014 2:46 am
by InsertNameHere
Just like the title says how do i change a collision layers with a script in the onlazerhit scrip area on an object.
also sence i am not a scripter on this game i need some help and I need the info to help make my self a more
advanced transmission... please help? :thumbup:

Re: How do i change collision layers with the OnLazerHit script

PostPosted: Thu Jun 05, 2014 12:28 am
by dustville
put this script in onlazerhit (in the lasers script menu)
e.geom.collideset := (collideset id)
hears the collideset id list
1 = A
2 = B
3 = A, B
4 = C
etc
example
e.geom.collideset := 2
sets the collideset to B
e.geom.collideset := 1
sets the collideset to A
hope that helps
edit: i will make an example scene
edit2: http://www.algodoo.com/algobox/details.php?id=83538

Re: How do i change collision layers with the OnLazerHit script

PostPosted: Thu Jun 05, 2014 12:48 am
by electronicboy
The above infomation is correct, you can essentially map the collision layers to binary digits, each bit representing a different collision layer.

the variable "collideset" is on almost everything but joins, and can be accessed as a standard object variable. e.g. e.<this,other> and e.<geom,laser>.

Re: How do i change collision layers with the OnLazerHit script

PostPosted: Fri Mar 16, 2018 9:53 pm
by randommy100
I use 2.1.0, and I'm pretty sure onLazerHit is onHitByLaser nowadays.
I also have made a marble race that uses e.other.collideSet in the onCollide script.