help with oncollide scripts
3 posts • Page 1 of 1
help with oncollide scripts
sorry it's a bit blurry discription but i'm from holland and don't now so well how to explain this in english
- jessebax129
- Posts: 34
- Joined: Tue Jan 05, 2010 6:32 pm
Re: help with oncollide scripts
I understand what you mean. Unfortunately you can't activate a script unless it is hitting/touching something.
-

standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: help with oncollide scripts
jessebax129 wrote::cry: i have got a problem: i want to make a scene that locks something, but it has to be an collide script like when it collides, scene.my.speed = 15 but when the laser doesn't collide with anything scene.my.speed has to me 0 so it is like an ''if'''structure but without the collideinformation from the other geom
sorry it's a bit blurry discription but i'm from holland and don't now so well how to explain this in english
I think there's a way to do this, it works by giving a set amount of time before switching off.
First, declare these variable in the console (Tilde ("~"))
- Code: Select all
Scene.my.LastTime = 0; Scene.my.Speed = {(Scene.my.LastTime + 0.02) > Sim.time ? {15} : {0}}
In the laser:
- Code: Select all
onLaserHit = (e)=>{Scene.my.LastTime = Sim.time}
Hopefully this is what you wanted, if it's not, then just say
--
Grady
- gradyfitz
- Posts: 174
- Joined: Tue Sep 01, 2009 8:33 am
- Location: Victoria, Australia
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests



