How do i change collision layers with the OnLazerHit script

Post your tutorials here.

How do i change collision layers with the OnLazerHit script

Postby InsertNameHere » Wed Jun 04, 2014 2:46 am

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:
Epic
User avatar
InsertNameHere
 
Posts: 60
Joined: Tue May 27, 2014 11:31 pm
Location: Claremore Oklahoma

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

Postby dustville » Thu Jun 05, 2014 12:28 am

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
dustville
 
Posts: 20
Joined: Sat Apr 19, 2014 6:13 am
Location: somewere

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

Postby electronicboy » Thu Jun 05, 2014 12:48 am

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>.
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

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

Postby randommy100 » Fri Mar 16, 2018 9:53 pm

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.
Attachments
Random collision marble race.phz
(48.87 KiB) Downloaded 393 times
Random collision marble race.phz
Sorry for the duplicate.
(48.87 KiB) Downloaded 384 times
randommy100
 
Posts: 1
Joined: Fri Mar 16, 2018 9:46 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest