Set collision layers on a object with onCollide?
2 posts • Page 1 of 1
Re: Set collision layers on a object with onCollide?
Use collideSet. If you look you can find it in the script menu. But here's the tricky thing. As it uses numbers, they don't go like 1, 2, 3, 4, 5... ect. You basically multiply the lowest number by 2 to get the next highest collideset. So, collideset A is 1, B is 2, C is 4, D is 8, and so on. So, if you need collideset F, just find out what number E has (16 btw) and multiply it by 2, and you get 32 which is what you'll need! Also, if you want to spawn an object that collides with nothing, just use collideset = 0. And if you want selfcollision, put heterocollide = true/false. And if you don't want it to collide with water, put collidewater = false. If you want to spawn an object with multiple collision layers, just take the numbers of the individual collidesets and add them up. So, if you want to spawn an object with collision layers A and B, just take 1 + 2 = 3, and put that. I hope that helped, I'm not very good at explaining Thyme....
(/)(°,,,°)(/)
-
pnvv - Posts: 670
- Joined: Tue Aug 26, 2014 11:46 pm
- Location: Disunited States of America
Re: Set collision layers on a object with onCollide?
You do it similar to setting the collideset inside the shape itself, just this time using the variable instead of an editing text field:
collideset := <value>
the value of the collideset equals:
1(A) + 2(B) + 4(C) + 8(D) + 16(E) + 32(F) + 64(G) + 128(H)
Depending on what collision layers are selected, add their numeric value to the total. so collideset A B C would be 7, B D H would be 138
collideset := <value>
the value of the collideset equals:
1(A) + 2(B) + 4(C) + 8(D) + 16(E) + 32(F) + 64(G) + 128(H)
Depending on what collision layers are selected, add their numeric value to the total. so collideset A B C would be 7, B D H would be 138
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests