Data Realms Fan Forums http://45.55.195.193/ |
|
Grenade explosion timer AFTER bounce http://45.55.195.193/viewtopic.php?f=1&t=31474 |
Page 1 of 1 |
Author: | AndyChanglee [ Sun Jul 22, 2012 12:47 am ] |
Post subject: | Grenade explosion timer AFTER bounce |
Right now, whether or not the grenade ever touches anything on Bound Mode, it still explodes after a set time. What i'm thinking of is just adding a little bit to the GrenadeBounce.lua so that the timer starts after it hits something, but I have no idea what. Does anybody know if this is possible, and example code would be greatly appreciated! |
Author: | Azukki [ Sun Jul 22, 2012 9:30 pm ] |
Post subject: | Re: Grenade explosion timer AFTER bounce |
You could do a check for a major change in speed, which would indicate the collision. something like if self.Vel.Magnitude < self.previousvelmag - 10 or self.Vel.Magnitude > self.previousvelmag + 10 then [start timer to do the other stuff] end self.previousvelmag = self.Vel.Magnitude Alternatively, you could have one non-timed grenade that gibs into the timed one, but switching objects out mid-collision makes the collision a little funky, IIRC. |
Author: | AndyChanglee [ Mon Jul 23, 2012 1:35 pm ] |
Post subject: | Re: Grenade explosion timer AFTER bounce |
Thanks, that sounds nice! |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |