Two things will be delete after crash
4 posts • Page 1 of 1
Two things will be delete after crash
(My English not very good, sorry)
I asked last time, "density = 0" is a way to delete the thing
but this time i want two things will be delete after crash
just like this:
O------------> <--------------O
OO (crash)
(both no more)
for the first one, i can make it onCollide : (e)=>{density = 0}
but I can't use this for the second one, because before the second object crash on to first object, second object have already collide.
If I do not explain clearly, please tell me, thanks!
I asked last time, "density = 0" is a way to delete the thing
but this time i want two things will be delete after crash
just like this:
O------------> <--------------O
OO (crash)
(both no more)
for the first one, i can make it onCollide : (e)=>{density = 0}
but I can't use this for the second one, because before the second object crash on to first object, second object have already collide.
If I do not explain clearly, please tell me, thanks!
- dogwong
- Posts: 8
- Joined: Wed Oct 21, 2009 12:28 pm
Re: Two things will be delete after crash
try this on the first object
- Code: Select all
(e)=>{e.other.density = 0; e.this.density = 0}
When asking for help, READ THE STICKIES!
- electronicboy
- Posts: 1694
- Joined: Mon Aug 31, 2009 6:18 pm
Re: Two things will be delete after crash
oh yes, thanks!
how about
if two things crash, one of it will delete, and the gun will be delete also (LOL)
thx
how about
if two things crash, one of it will delete, and the gun will be delete also (LOL)
thx
- dogwong
- Posts: 8
- Joined: Wed Oct 21, 2009 12:28 pm
Re: Two things will be delete after crash
So you have an entire gun and you want to delete it as well as the two objects?
Make a variable:
In the onCollide script of an object put:
In the density part of the script menu on the gun put:
How's that?
Make a variable:
- Code: Select all
scene.my.density = 2
In the onCollide script of an object put:
- Code: Select all
scene.my.density = 0
In the density part of the script menu on the gun put:
- Code: Select all
{scene.my.density}
How's that?
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 14 guests