Data Realms Fan Forums http://45.55.195.193/ |
|
Problem changing the velocity/angle of a spawned emitter. http://45.55.195.193/viewtopic.php?f=73&t=15861 |
Page 1 of 1 |
Author: | Foogooman [ Tue Jul 14, 2009 10:17 pm ] |
Post subject: | Problem changing the velocity/angle of a spawned emitter. |
So, my script spawns an emitter that flies across the map. I want it to spawn high at get fired to the left and downwards. So I put this code in Code: SandP.Vel.X = -math.random(150) - 50; SandP.Vel.Y = -math.random(35) - 40; The line "SandP.Vel.X = -math.random(150) - 50;" works just dandy, sending the emitter flying to the left at a nice speed. The line "SandP.Vel.Y = -math.random(35) - 40;" doesn't work so well. It made the partciels fly upwards instead of downwards. So, I changed it to "SandP.Vel.Y = -math.random(-35) - -40;" thinking that making them negative would cause the emitter to fly down. However, now the emitter never spawns at all. how can I get it to have a downward velocity? |
Author: | Mind [ Tue Jul 14, 2009 10:21 pm ] |
Post subject: | Re: Problem changing the velocity/angle of a spawned emitter. |
Use this Code: SandP.Vel.Y = math.random(35) + 40; Edit: Y is switched around in CC. negative y velocity is upward, positive y velocity is downward. |
Author: | Grif [ Tue Jul 14, 2009 10:25 pm ] |
Post subject: | Re: Problem changing the velocity/angle of a spawned emitter. |
Man I lose count of how many times I've said this. CC's whole entire coordinate system (all of it) is based on the fourth quadrant of a graph. The top left corner of a scene is the "origin" of that graph. You will never need negative scene coordinates. |
Author: | mail2345 [ Tue Jul 14, 2009 11:53 pm ] |
Post subject: | Re: Problem changing the velocity/angle of a spawned emitter. |
Velocity is the vector in question, Grif. |
Author: | Grif [ Wed Jul 15, 2009 2:29 am ] |
Post subject: | Re: Problem changing the velocity/angle of a spawned emitter. |
It's still the same system. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |