How to make a beacon
Posted: Tue Nov 10, 2009 4:56 pm
A beacon is an object that is constantly updating a script such as positions.
Make two boxes, one right next to the other. Make sure that the right box collides with B. Make a circle with a center hinge and place it slightly inside both boxes like so:
To make sure that the beacon can stay together as one object we will make a box behind it and connect everything to it.
In the script of the left box put:
In the script of the right box put:
Put your script that you want to be updated constantly in the circle. Now you're done! It's actually very easy to do this. You can also do this with lasers!
Make sure that the object that the laser is hitting collides with A and B. You can also use this same laser method to change the collideSet of an object. Just replace all parts that say laser with geom.
Make two boxes, one right next to the other. Make sure that the right box collides with B. Make a circle with a center hinge and place it slightly inside both boxes like so:
To make sure that the beacon can stay together as one object we will make a box behind it and connect everything to it.
In the script of the left box put:
- Code: Select all
e.other.collideSet = 2
In the script of the right box put:
- Code: Select all
e.other.collideSet = 1
Put your script that you want to be updated constantly in the circle. Now you're done! It's actually very easy to do this. You can also do this with lasers!
- Code: Select all
onLaserHit = (e)=>{e.laser.collideSet == 1 ? {e.laser.collideSet = 2} : {e.laser.collideSet == 2 ? {e.laser.collideSet = 1} : {}}}
Make sure that the object that the laser is hitting collides with A and B. You can also use this same laser method to change the collideSet of an object. Just replace all parts that say laser with geom.