How do i change collision layers with the OnLazerHit script
4 posts • Page 1 of 1
How do i change collision layers with the OnLazerHit script
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?
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?
Epic
-
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
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
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
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>.
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
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.
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
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests